From 360ad2baeba15dfd6e4374d5fa3834cedc34880e Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 21 Oct 2007 20:52:05 +0000 Subject: AR no long adds/updates/deletes automatically. --- HISTORY | 1 + UPGRADE | 3 ++- demos/quickstart/protected/pages/Database/ActiveRecord.page | 2 ++ framework/Data/ActiveRecord/TActiveRecordGateway.php | 8 ++++---- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/HISTORY b/HISTORY index 29982ffc..5eb35871 100644 --- a/HISTORY +++ b/HISTORY @@ -3,6 +3,7 @@ Version 3.1.2 To be released BUG: Ticket#719 - TAutoCompleter should not trigger Validation if CausesValidation=False (Christophe) CHG: Changed TConditional so that the controls in its template behave like they are in its parent (Qiang) CHG: Active Record many-to-many relationship change from self::HAS_MANY to self::MANY_TO_MANY (Wei) +CHG: Active Record no longer automatically performs adding/removing/updating related objects (Qiang) ENH: Ticket#722 - Add Read Only capabilities to TInPlaceTextBox (Christophe) ENH: Active Record supports multiple foreign references of the same table (Wei) ENH: Added TDbCommand.queryColumn() (Qiang) diff --git a/UPGRADE b/UPGRADE index 334f8231..5dc3ff93 100644 --- a/UPGRADE +++ b/UPGRADE @@ -13,10 +13,11 @@ Upgrading from v3.1.1 --------------------- - The RELATIONS type declaration in Active Record classes for Many-to-Many using an association table was change from "self::HAS_MANY" to "self::MANY_TO_MANY". - E.g. change + E.g. change 'albums' => array(self::HAS_MANY, 'Artist', 'album_artists') to 'albums' => array(self::MANY_TO_MANY, 'Artist', 'album_artists') +- Active Record no longer automatically adds/removes/updates related objects. Upgrading from v3.1.0 diff --git a/demos/quickstart/protected/pages/Database/ActiveRecord.page b/demos/quickstart/protected/pages/Database/ActiveRecord.page index d2793fa1..28beaa93 100644 --- a/demos/quickstart/protected/pages/Database/ActiveRecord.page +++ b/demos/quickstart/protected/pages/Database/ActiveRecord.page @@ -1010,6 +1010,7 @@ be specified as comma separated values between brackets. E.g. 'related_items.(id1,id2)'. +

Lazy Loading Related Objects

diff --git a/framework/Data/ActiveRecord/TActiveRecordGateway.php b/framework/Data/ActiveRecord/TActiveRecordGateway.php index 6c5bc07c..5df42f59 100644 --- a/framework/Data/ActiveRecord/TActiveRecordGateway.php +++ b/framework/Data/ActiveRecord/TActiveRecordGateway.php @@ -258,11 +258,11 @@ class TActiveRecordGateway extends TComponent */ public function insert(TActiveRecord $record) { - $this->updateAssociatedRecords($record,true); + //$this->updateAssociatedRecords($record,true); $result = $this->getCommand($record)->insert($this->getInsertValues($record)); if($result) $this->updatePostInsert($record); - $this->updateAssociatedRecords($record); + //$this->updateAssociatedRecords($record); return $result; } @@ -313,10 +313,10 @@ class TActiveRecordGateway extends TComponent */ public function update(TActiveRecord $record) { - $this->updateAssociatedRecords($record,true); + //$this->updateAssociatedRecords($record,true); list($data, $keys) = $this->getUpdateValues($record); $result = $this->getCommand($record)->updateByPk($data, $keys); - $this->updateAssociatedRecords($record); + //$this->updateAssociatedRecords($record); return $result; } -- cgit v1.2.3