summaryrefslogtreecommitdiff
path: root/framework/Data/ActiveRecord/TActiveRecord.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Data/ActiveRecord/TActiveRecord.php')
-rw-r--r--framework/Data/ActiveRecord/TActiveRecord.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/framework/Data/ActiveRecord/TActiveRecord.php b/framework/Data/ActiveRecord/TActiveRecord.php
index bdb03596..ea33035d 100644
--- a/framework/Data/ActiveRecord/TActiveRecord.php
+++ b/framework/Data/ActiveRecord/TActiveRecord.php
@@ -172,6 +172,16 @@ abstract class TActiveRecord extends TComponent
*/
public function save()
{
+ $this->commitChanges();
+ }
+
+ /**
+ * Commit changes to the record, may insert, update or delete depending
+ * on the record state given in TObjectStateRegistery.
+ * @return boolean true if changes were made.
+ */
+ protected function commitChanges()
+ {
$registry = $this->getRecordManager()->getObjectStateRegistry();
$gateway = $this->getRecordManager()->getRecordGateway();
if(!$this->_readOnly)
@@ -190,7 +200,7 @@ abstract class TActiveRecord extends TComponent
{
$registry = $this->getRecordManager()->getObjectStateRegistry();
$registry->registerRemoved($this);
- return $this->save();
+ return $this->commitChanges();
}
/**