Changeset 3930
- Timestamp:
- 03/05/08 11:20:40 (16 months ago)
- Location:
- branches/0.10
- Files:
-
- 4 modified
-
lib/Doctrine/Hydrator/RecordDriver.php (modified) (5 diffs)
-
lib/Doctrine/Record.php (modified) (1 diff)
-
tests/RecordTestCase.php (modified) (2 diffs)
-
tests/Ticket/428TestCase.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.10/lib/Doctrine/Hydrator/RecordDriver.php
r3884 r3930 21 21 22 22 /** 23 * Doctrine_Hydrate_Record 24 * defines a record fetching strategy for Doctrine_Hydrate23 * Doctrine_Hydrate_RecordDriver 24 * Hydration strategy used for creating collections of entity objects. 25 25 * 26 26 * @package Doctrine … … 31 31 * @version $Revision$ 32 32 * @author Konsta Vesterinen <kvesteri@cc.hut.fi> 33 * @author Roman Borschel <roman@code-factory.org> 33 34 */ 34 35 class Doctrine_Hydrator_RecordDriver extends Doctrine_Locator_Injectable 35 36 { 36 37 protected $_collections = array(); 37 38 protected $_records = array();39 40 38 protected $_tables = array(); 41 39 … … 81 79 * @return boolean 82 80 */ 83 public function isIdentifiable(array $row, Doctrine_Table $table)81 /*public function isIdentifiable(array $row, Doctrine_Table $table) 84 82 { 85 83 $primaryKeys = $table->getIdentifierColumnNames(); … … 97 95 } 98 96 return true; 99 } 97 }*/ 100 98 101 99 public function getNullPointer() … … 114 112 $record = $this->_tables[$component]->getRecord(); 115 113 116 if ( ! isset($this->_records[$record->getOid()]) ) {117 $record->clearRelated();118 $this->_records[$record->getOid()] = $record;119 }120 121 114 return $record; 122 115 } -
branches/0.10/lib/Doctrine/Record.php
r3907 r3930 679 679 } 680 680 $query->where(implode(' = ? AND ', $this->getTable()->getIdentifierColumnNames()) . ' = ?'); 681 $this->clearRelated(); 681 682 $record = $query->fetchOne($id); 682 683 } else { -
branches/0.10/tests/RecordTestCase.php
r3884 r3930 766 766 $user = $this->objTable->find(5); 767 767 $this->assertEqual($user->Group->count(), 3); 768 $this->assertEqual($user->Group[1]->id, 2);769 $this->assertEqual($user->Group[2]->id, 3);768 $this->assertEqual($user->Group[1]->id, 1); 769 $this->assertEqual($user->Group[2]->id, 2); 770 770 771 771 $user->unlink('Group', array($group1->id, $group2->id)); … … 792 792 $user = $this->objTable->find(5); 793 793 $this->assertEqual($user->Group->count(), 2); 794 $this->assertEqual($user->Group[0]->identifier(), $group 1->identifier());795 $this->assertEqual($user->Group[1]->identifier(), $group 2->identifier());794 $this->assertEqual($user->Group[0]->identifier(), $group2->identifier()); 795 $this->assertEqual($user->Group[1]->identifier(), $group1->identifier()); 796 796 797 797 $user->unlink('Group'); 798 798 $user->save(); 799 unset($user);799 $user->free(); 800 800 801 801 $user = $this->objTable->find(5); -
branches/0.10/tests/Ticket/428TestCase.php
r3884 r3930 14 14 class Doctrine_Ticket_428_TestCase extends Doctrine_UnitTestCase 15 15 { 16 private $_albums; 17 16 18 public function prepareData() 17 19 { … … 31 33 $albums->save(); 32 34 $this->assertEqual(count($albums[0]->Song), 4); 35 $this->_albums = $albums; 33 36 } 34 37 35 38 public function testAggregateValueMappingSupportsLeftJoins() 36 39 { 40 foreach ($this->_albums as $album) { 41 $album->clearRelated(); 42 } 43 37 44 $q = new Doctrine_Query(); 38 45