From cbbb7b2a8813496d9f1b5521ee6b0c651f166ce5 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Wed, 9 May 2012 05:52:52 +0200 Subject: [PATCH] Make an object actually hold up-to-date sanitized data after updating it --- frontend/classes/class.container.php | 2 -- frontend/cphp/class.databaserecord.php | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/classes/class.container.php b/frontend/classes/class.container.php index 2362169..61325a8 100644 --- a/frontend/classes/class.container.php +++ b/frontend/classes/class.container.php @@ -249,8 +249,6 @@ class Container extends CPHPDatabaseRecordClass $this->uRootPassword = $sRootPassword; $this->InsertIntoDatabase(); - var_dump($this->sTemplate->sTemplateName); - $command = shrink_command("vzctl create {$this->sInternalId} --ostemplate {$this->sTemplate->sTemplateName} "); diff --git a/frontend/cphp/class.databaserecord.php b/frontend/cphp/class.databaserecord.php index 4c1062d..d0b7893 100644 --- a/frontend/cphp/class.databaserecord.php +++ b/frontend/cphp/class.databaserecord.php @@ -34,6 +34,11 @@ abstract class CPHPDatabaseRecordClass extends CPHPBaseClass $this->EventConstructed(); } + public function RefreshData() + { + $this->ConstructDataset($this->sId); + } + public function ConstructDataset($uDataSource, $uCommunityId = 0) { $bind_datasets = true; @@ -348,6 +353,7 @@ abstract class CPHPDatabaseRecordClass extends CPHPBaseClass } $this->PurgeCache(); + $this->RefreshData(); return $result; }