diff options
author | wei <> | 2007-02-19 02:23:19 +0000 |
---|---|---|
committer | wei <> | 2007-02-19 02:23:19 +0000 |
commit | 826a0ceb950872bb311addd24c1a8da76a1cccc6 (patch) | |
tree | da833758be6a683a4cada41c417a522698705758 /framework/Data/ActiveRecord/TActiveRecord.php | |
parent | db1a9b1af8aee6d5967e96d3f8928d1576c45daf (diff) |
Add trace to active records and TDbCommand
Diffstat (limited to 'framework/Data/ActiveRecord/TActiveRecord.php')
-rw-r--r-- | framework/Data/ActiveRecord/TActiveRecord.php | 12 |
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();
}
/**
|