diff options
| -rw-r--r-- | HISTORY | 1 | ||||
| -rw-r--r-- | UPGRADE | 3 | ||||
| -rw-r--r-- | demos/quickstart/protected/pages/Database/ActiveRecord.page | 2 | ||||
| -rw-r--r-- | framework/Data/ActiveRecord/TActiveRecordGateway.php | 8 | 
4 files changed, 9 insertions, 5 deletions
| @@ -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) @@ -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.  <tt>'related_items.(id1,id2)'</tt>.  </div> +<!---  <h2 id="142014">Adding/Removing/Updating Related Objects</h2>  <p id="710041" class="block-content">Related objects can be simply inserted/updated by first adding those related objects to @@ -1048,6 +1049,7 @@ PlayerSkillAssocation::finder()->deleteByPk(array('fk1','fk2'));  //where 'fk1' is the primary key value of a player  // and 'fk2' is the primary key value of a skill  </com:TTextHighlighter> +--->  <h2 id="142015">Lazy Loading Related Objects</h2> 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;
  	}
 | 
