Changeset 4706
- Timestamp:
- 07/23/08 22:21:13 (4 months ago)
- Location:
- branches
- Files:
-
- 13 modified
-
0.11/lib/Doctrine/Pager.php (modified) (1 diff)
-
0.11/lib/Doctrine/Pager/Layout.php (modified) (1 diff)
-
0.11/lib/Doctrine/Tree/Interface.php (modified) (2 diffs)
-
0.11/lib/Doctrine/Tree/NestedSet.php (modified) (2 diffs)
-
0.11/manual/docs/en/utilities/pagination/advanced-layouts-with-pager.txt (modified) (1 diff)
-
0.11/manual/docs/en/utilities/pagination/working-with-pager.txt (modified) (1 diff)
-
1.0/docs/manual/en/utilities/pagination/advanced-layouts-with-pager.txt (modified) (1 diff)
-
1.0/docs/manual/en/utilities/pagination/working-with-pager.txt (modified) (1 diff)
-
1.0/lib/Doctrine/Pager.php (modified) (1 diff)
-
1.0/lib/Doctrine/Pager/Layout.php (modified) (1 diff)
-
1.0/lib/Doctrine/Tree/Interface.php (modified) (2 diffs)
-
1.0/lib/Doctrine/Tree/NestedSet.php (modified) (4 diffs)
-
1.0/tests/Ticket/1250TestCase.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.11/lib/Doctrine/Pager.php
r4398 r4706 562 562 * 563 563 * @param $params Optional parameters to Doctrine_Query::execute 564 * @param $hydrationMode Hydration Mode of Doctrine_Query::execute 565 * returned ResultSet. Doctrine::Default is FETCH_RECORD 564 * @param $hydrationMode Hydration Mode of Doctrine_Query::execute returned ResultSet. 566 565 * @return Doctrine_Collection The root collection 567 566 */ 568 public function execute($params = array(), $hydrationMode = Doctrine::FETCH_RECORD)567 public function execute($params = array(), $hydrationMode = null) 569 568 { 570 569 if (!$this->getExecuted()) { -
branches/0.11/lib/Doctrine/Pager/Layout.php
r4252 r4706 124 124 * 125 125 * @param $params Optional parameters to Doctrine_Query::execute 126 * @param $hydrationMode Hydration Mode of Doctrine_Query::execute 127 * returned ResultSet. Doctrine::Default is FETCH_RECORD 126 * @param $hydrationMode Hydration Mode of Doctrine_Query::execute returned ResultSet. 128 127 * @return Doctrine_Collection The root collection 129 128 */ 130 public function execute($params = array(), $hydrationMode = Doctrine::FETCH_RECORD)129 public function execute($params = array(), $hydrationMode = null) 131 130 { 132 131 return $this->getPager()->execute($params, $hydrationMode); -
branches/0.11/lib/Doctrine/Tree/Interface.php
r4656 r4706 51 51 * 52 52 * @param array $options options 53 * @param integer $fetchmode One of the Doctrine::HYDRATE_* constants.53 * @param integer $fetchmode One of the Doctrine::HYDRATE_* constants. 54 54 * @return object $iterator instance of Doctrine_Node_<Implementation>_PreOrderIterator 55 55 */ 56 public function fetchTree($options = array(), $hydrationMode = Doctrine::HYDRATE_RECORD);56 public function fetchTree($options = array(), $hydrationMode = null); 57 57 58 58 /** … … 61 61 * @param mixed $pk primary key as used by table::find() to locate node to traverse tree from 62 62 * @param array $options options 63 * @param 63 * @param integer $fetchmode One of the Doctrine::HYDRATE_* constants. 64 64 * @return iterator instance of Doctrine_Node_<Implementation>_PreOrderIterator 65 65 */ 66 public function fetchBranch($pk, $options = array(), $hydrationMode = Doctrine::HYDRATE_RECORD);66 public function fetchBranch($pk, $options = array(), $hydrationMode = null); 67 67 } -
branches/0.11/lib/Doctrine/Tree/NestedSet.php
r4656 r4706 159 159 } 160 160 161 $q = $this->returnQueryWithRootId($q, $rootId)->setHydrationMode($hydrationMode); 161 $q = $this->returnQueryWithRootId($q, $rootId); 162 163 // FIX: Reported in ticket #1268 164 if ($hydrationMode !== null) { 165 $q = $q->setHydrationMode($hydrationMode); 166 } 167 162 168 $tree = $q->execute(); 163 169 … … 191 197 $q->addWhere($this->_baseAlias . ".lft >= ? AND " . $this->_baseAlias . ".rgt <= ?", $params) 192 198 ->addOrderBy($this->_baseAlias . ".lft asc"); 193 $q = $this->returnQueryWithRootId($q, $record->getNode()->getRootValue()) 194 ->setHydrationMode($hydrationMode); 199 $q = $this->returnQueryWithRootId($q, $record->getNode()->getRootValue()); 200 201 // FIX: Reported in ticket #1268 202 if ($hydrationMode !== null) { 203 $q = $q->setHydrationMode($hydrationMode); 204 } 205 195 206 return $q->execute(); 196 207 } -
branches/0.11/manual/docs/en/utilities/pagination/advanced-layouts-with-pager.txt
r4159 r4706 157 157 158 158 // Handy method to execute the query without need to retrieve the Pager instance 159 $pager_layout->execute($params = array(), $hydrationMode = Doctrine::FETCH_RECORD);159 $pager_layout->execute($params = array(), $hydrationMode = null); 160 160 </code> 161 161 -
branches/0.11/manual/docs/en/utilities/pagination/working-with-pager.txt
r4398 r4706 36 36 37 37 <code type="php"> 38 $items = $pager->execute([$args = array() [, $fetchType = Doctrine::FETCH_RECORD]]);38 $items = $pager->execute([$args = array() [, $fetchType = null]]); 39 39 40 40 foreach ($items as $item) { -
branches/1.0/docs/manual/en/utilities/pagination/advanced-layouts-with-pager.txt
r4674 r4706 157 157 158 158 // Handy method to execute the query without need to retrieve the Pager instance 159 $pager_layout->execute($params = array(), $hydrationMode = Doctrine::FETCH_RECORD);159 $pager_layout->execute($params = array(), $hydrationMode = null); 160 160 </code> 161 161 -
branches/1.0/docs/manual/en/utilities/pagination/working-with-pager.txt
r4674 r4706 36 36 37 37 <code type="php"> 38 $items = $pager->execute([$args = array() [, $fetchType = Doctrine::FETCH_RECORD]]);38 $items = $pager->execute([$args = array() [, $fetchType = null]]); 39 39 40 40 foreach ($items as $item) { -
branches/1.0/lib/Doctrine/Pager.php
r4398 r4706 562 562 * 563 563 * @param $params Optional parameters to Doctrine_Query::execute 564 * @param $hydrationMode Hydration Mode of Doctrine_Query::execute 565 * returned ResultSet. Doctrine::Default is FETCH_RECORD 564 * @param $hydrationMode Hydration Mode of Doctrine_Query::execute returned ResultSet. 566 565 * @return Doctrine_Collection The root collection 567 566 */ 568 public function execute($params = array(), $hydrationMode = Doctrine::FETCH_RECORD)567 public function execute($params = array(), $hydrationMode = null) 569 568 { 570 569 if (!$this->getExecuted()) { 571 570 $this->_initialize($params); 572 571 } 573 572 574 573 return $this->getQuery()->execute($params, $hydrationMode); 575 574 } -
branches/1.0/lib/Doctrine/Pager/Layout.php
r4252 r4706 124 124 * 125 125 * @param $params Optional parameters to Doctrine_Query::execute 126 * @param $hydrationMode Hydration Mode of Doctrine_Query::execute 127 * returned ResultSet. Doctrine::Default is FETCH_RECORD 126 * @param $hydrationMode Hydration Mode of Doctrine_Query::execute returned ResultSet. 128 127 * @return Doctrine_Collection The root collection 129 128 */ 130 public function execute($params = array(), $hydrationMode = Doctrine::FETCH_RECORD)129 public function execute($params = array(), $hydrationMode = null) 131 130 { 132 131 return $this->getPager()->execute($params, $hydrationMode); -
branches/1.0/lib/Doctrine/Tree/Interface.php
r4656 r4706 54 54 * @return object $iterator instance of Doctrine_Node_<Implementation>_PreOrderIterator 55 55 */ 56 public function fetchTree($options = array(), $hydrationMode = Doctrine::HYDRATE_RECORD);56 public function fetchTree($options = array(), $hydrationMode = null); 57 57 58 58 /** … … 61 61 * @param mixed $pk primary key as used by table::find() to locate node to traverse tree from 62 62 * @param array $options options 63 * @param 63 * @param integer $fetchmode One of the Doctrine::HYDRATE_* constants. 64 64 * @return iterator instance of Doctrine_Node_<Implementation>_PreOrderIterator 65 65 */ 66 public function fetchBranch($pk, $options = array(), $hydrationMode = Doctrine::HYDRATE_RECORD);66 public function fetchBranch($pk, $options = array(), $hydrationMode = null); 67 67 } -
branches/1.0/lib/Doctrine/Tree/NestedSet.php
r4656 r4706 143 143 * @return mixed The tree or FALSE if the tree could not be found. 144 144 */ 145 public function fetchTree($options = array(), $hydrationMode = Doctrine::HYDRATE_RECORD)145 public function fetchTree($options = array(), $hydrationMode = null) 146 146 { 147 147 // fetch tree … … 159 159 } 160 160 161 $q = $this->returnQueryWithRootId($q, $rootId)->setHydrationMode($hydrationMode); 161 $q = $this->returnQueryWithRootId($q, $rootId); 162 163 // FIX: Reported in ticket #1268 164 if ($hydrationMode !== null) { 165 $q = $q->setHydrationMode($hydrationMode); 166 } 167 162 168 $tree = $q->execute(); 163 169 … … 178 184 * @todo Only fetch the lft and rgt values of the initial record. more is not needed. 179 185 */ 180 public function fetchBranch($pk, $options = array(), $hydrationMode = Doctrine::HYDRATE_RECORD)186 public function fetchBranch($pk, $options = array(), $hydrationMode = null) 181 187 { 182 188 $record = $this->table->find($pk); … … 191 197 $q->addWhere($this->_baseAlias . ".lft >= ? AND " . $this->_baseAlias . ".rgt <= ?", $params) 192 198 ->addOrderBy($this->_baseAlias . ".lft asc"); 193 $q = $this->returnQueryWithRootId($q, $record->getNode()->getRootValue()) 194 ->setHydrationMode($hydrationMode); 199 $q = $this->returnQueryWithRootId($q, $record->getNode()->getRootValue()); 200 201 // FIX: Reported in ticket #1268 202 if ($hydrationMode !== null) { 203 $q = $q->setHydrationMode($hydrationMode); 204 } 205 195 206 return $q->execute(); 196 207 } -
branches/1.0/tests/Ticket/1250TestCase.php
r4688 r4706 40 40 try { 41 41 $r = new Doctrine_Ticket_1250_i18n(); 42 // This is needed since all fields are internationalized. 43 // Reason for not fixing that is BC. Manual describes this behavior very well 44 $r->state('TDIRTY'); 42 45 $r->Translation['en']->title = 'Title in english'; 43 46 $r->Translation['en']->content = 'Content in english';