Changeset 474
- Timestamp:
- 20.10.2006 18:24:30 (4 years ago)
- Location:
- branches/1.3
- Files:
-
- 7 edited
-
contrib/pat/patForms/Datasource/Propel.php (modified) (1 diff)
-
contrib/pear/Structures_DataGrid_Propel/Propel.php (modified) (2 diffs)
-
generator/classes/propel/engine/builder/om/PeerBuilder.php (modified) (1 diff)
-
generator/classes/propel/engine/builder/om/php5/PHP5BasicObjectBuilder.php (modified) (1 diff)
-
generator/classes/propel/engine/builder/om/php5/PHP5BasicPeerBuilder.php (modified) (3 diffs)
-
generator/classes/propel/engine/builder/om/php5/PHP5ComplexPeerBuilder.php (modified) (3 diffs)
-
generator/classes/propel/engine/builder/om/php5/PHP5NodePeerBuilder.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3/contrib/pat/patForms/Datasource/Propel.php
r64 r474 42 42 } 43 43 44 $rs = AuthorPeer::doSelect Rs($c);44 $rs = AuthorPeer::doSelectStmt($c); 45 45 $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC); 46 46 while ($rs->next()) { -
branches/1.3/contrib/pear/Structures_DataGrid_Propel/Propel.php
r64 r474 294 294 $dbMap = $mapBuilder->getDatabaseMap(); 295 295 $cols = $dbMap->getTable(constant($this->getPeerName()."::TABLE_NAME"))->getColumns(); 296 $ rs = call_user_func(array( $this->getPeerName(), 'doSelectRS'), $this->criteria);296 $stmt = call_user_func(array( $this->getPeerName(), 'doSelectStmt'), $this->criteria); 297 297 298 298 $dataset = array(); … … 300 300 $this->primaryKeys = array(); 301 301 $class = $this->getClassName(); 302 while($r s->next()) { // use Creole ResultSet methods to iterate over resultset302 while($row = $stmt->fetch(PDO::FETCH_NUM)) { // use Creole ResultSet methods to iterate over resultset 303 303 $obj = new $class(); 304 $obj->hydrate($r s);304 $obj->hydrate($row); 305 305 306 306 $row = array(); -
branches/1.3/generator/classes/propel/engine/builder/om/PeerBuilder.php
r444 r474 62 62 $this->addDoSelectOne($script); 63 63 $this->addDoSelect($script); 64 $this->addDoSelect RS($script); // <-- there's Creolecode in here65 $this->addPopulateObjects($script); // <-- there's Creolecode in here64 $this->addDoSelectStmt($script); // <-- there's PDO code in here 65 $this->addPopulateObjects($script); // <-- there's PDO code in here 66 66 67 67 } -
branches/1.3/generator/classes/propel/engine/builder/om/php5/PHP5BasicObjectBuilder.php
r460 r474 399 399 \$c->addSelectColumn(".$this->getColumnConstant($col)."); 400 400 try { 401 \$stmt = ".$this->getPeerClassname()."::doSelect RS(\$c, \$con);401 \$stmt = ".$this->getPeerClassname()."::doSelectStmt(\$c, \$con); 402 402 \$row = \$stmt->fetch(PDO::FETCH_NUM); 403 403 "; -
branches/1.3/generator/classes/propel/engine/builder/om/php5/PHP5BasicPeerBuilder.php
r470 r474 492 492 } 493 493 494 \$stmt = ".$this->getPeerClassname()."::doSelect RS(\$criteria, \$con);494 \$stmt = ".$this->getPeerClassname()."::doSelectStmt(\$criteria, \$con); 495 495 if (\$row = \$stmt->fetch(PDO::FETCH_NUM)) { 496 496 return \$row[0]; … … 548 548 public static function doSelect(Criteria \$criteria, PDO \$con = null) 549 549 { 550 return ".$this->getPeerClassname()."::populateObjects(".$this->getPeerClassname()."::doSelect RS(\$criteria, \$con));550 return ".$this->getPeerClassname()."::populateObjects(".$this->getPeerClassname()."::doSelectStmt(\$criteria, \$con)); 551 551 }"; 552 552 } 553 553 554 554 /** 555 * Adds the doSelectRS() method. 556 * @param string &$script The script will be modified in this method. 557 */ 558 protected function addDoSelectRS(&$script) 559 { 560 561 $script .= " 562 /** 563 * Prepares the Criteria object and uses the parent doSelect() 564 * method to get a ResultSet. 565 * 566 * Use this method directly if you want to just get the resultset 567 * (instead of an array of objects). 555 * Adds the doSelectStmt() method. 556 * @param string &$script The script will be modified in this method. 557 */ 558 protected function addDoSelectStmt(&$script) 559 { 560 561 $script .= " 562 /** 563 * Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement. 564 * 565 * Use this method directly if you want to work with an executed statement durirectly (for example 566 * to perform your own object hydration). 568 567 * 569 568 * @param Criteria \$criteria The Criteria object used to build the SELECT statement. … … 571 570 * @throws PropelException Any exceptions caught during processing will be 572 571 * rethrown wrapped into a PropelException. 573 * @return ResultSet The resultset object with numerically-indexed fields.572 * @return PDOStatement The executed PDOStatement object. 574 573 * @see ".$this->basePeerClassname."::doSelect() 575 574 */ 576 public static function doSelect RS(Criteria \$criteria, PDO \$con = null)575 public static function doSelectStmt(Criteria \$criteria, PDO \$con = null) 577 576 { 578 577 if (\$con === null) { -
branches/1.3/generator/classes/propel/engine/builder/om/php5/PHP5ComplexPeerBuilder.php
r471 r474 294 294 } 295 295 $script .= " 296 \$stmt = ".$this->getPeerClassname()."::doSelect RS(\$criteria, \$con);296 \$stmt = ".$this->getPeerClassname()."::doSelectStmt(\$criteria, \$con); 297 297 if (\$row = \$stmt->fetch(PDO::FETCH_NUM)) { 298 298 return \$row[0]; … … 550 550 551 551 $script .= " 552 \$stmt = ".$this->getPeerClassname()."::doSelect RS(\$criteria, \$con);552 \$stmt = ".$this->getPeerClassname()."::doSelectStmt(\$criteria, \$con); 553 553 if (\$row = \$stmt->fetch(PDO::FETCH_NUM)) { 554 554 return \$row[0]; … … 850 850 } // foreach fkeys 851 851 $script .= " 852 \$stmt = ".$this->getPeerClassname()."::doSelect RS(\$criteria, \$con);852 \$stmt = ".$this->getPeerClassname()."::doSelectStmt(\$criteria, \$con); 853 853 if (\$row = \$stmt->fetch(PDO::FETCH_NUM)) { 854 854 return \$row[0]; -
branches/1.3/generator/classes/propel/engine/builder/om/php5/PHP5NodePeerBuilder.php
r470 r474 314 314 { 315 315 \$criteria = $nodePeerClassname::buildFamilyCriteria(\$criteria, \$ancestors, \$descendants); 316 \$rs = ".$this->getStubPeerBuilder()->getClassname()."::doSelect RS(\$criteria, \$con);316 \$rs = ".$this->getStubPeerBuilder()->getClassname()."::doSelectStmt(\$criteria, \$con); 317 317 return self::populateNodes(\$rs, \$criteria); 318 318 } … … 370 370 \$criteria->add(self::NPATH_COLNAME, \$np, Criteria::EQUAL); 371 371 \$criteria = self::buildFamilyCriteria(\$criteria, \$ancestors, \$descendants); 372 \$rs = $peerClassname::doSelect RS(\$criteria, \$con);372 \$rs = $peerClassname::doSelectStmt(\$criteria, \$con); 373 373 \$nodes = self::populateNodes(\$rs, \$criteria); 374 374 return (count(\$nodes) == 1 ? \$nodes[0] : null);
Note: See TracChangeset
for help on using the changeset viewer.