Yanor.net/
Wiki
Blog
GitHub
Sandbox
開始行:
* JOIN [#i32c2190]
$c = new Criteria();
$c->add(GoodsPeer::ID, 123);
$c->addJoin(GoodsPeer::CATEGORY_ID, CategoryPeer::ID, Cr...
$rows = GoodsPeer::doSelectDetail($c, $this->con);
- 以上のようにaddJoin()でJOINを含んだSQLを発行出来るが、...
- よって、GoodsPeerクラスにdoSelectDetail()メソッドを追加...
class GoodsPeer extends BaseGoodsPeer
{
public static function doSelectDetail($criteria, $co...
parent::addSelectColumns($criteria);
$criteria->addSelectColumn(CategoryPeer::CATEGOR...
return GoodsPeer::populateDetailObjects(GoodsPeer...
}
public static function populateDetailObjects($stmt) {
$results = array();
$class = GoodsPeer::getOMClass();
$class = Propel::importClass($class);
$classDetail = $class."Detail";
while($row = $stmt->fetch(PDO::FETCH_NUM)) {
$obj = new $classDetail();
$obj->hydrate($row);
}
return $obj;
}
}
- 以上がGoodsPeerクラス。
- doSelectDetail()メソッド内でdoSelectStmt()を実行し、結...
- populateDetailObjects()で新しいクラスを作成し、そのイン...
** 参考 [#n8cd8a3f]
- http://www.centsys.jp/service/technical_information/sym...
- http://www.propelorm.org/wiki/Documentation/1.3/Upgrading
終了行:
* JOIN [#i32c2190]
$c = new Criteria();
$c->add(GoodsPeer::ID, 123);
$c->addJoin(GoodsPeer::CATEGORY_ID, CategoryPeer::ID, Cr...
$rows = GoodsPeer::doSelectDetail($c, $this->con);
- 以上のようにaddJoin()でJOINを含んだSQLを発行出来るが、...
- よって、GoodsPeerクラスにdoSelectDetail()メソッドを追加...
class GoodsPeer extends BaseGoodsPeer
{
public static function doSelectDetail($criteria, $co...
parent::addSelectColumns($criteria);
$criteria->addSelectColumn(CategoryPeer::CATEGOR...
return GoodsPeer::populateDetailObjects(GoodsPeer...
}
public static function populateDetailObjects($stmt) {
$results = array();
$class = GoodsPeer::getOMClass();
$class = Propel::importClass($class);
$classDetail = $class."Detail";
while($row = $stmt->fetch(PDO::FETCH_NUM)) {
$obj = new $classDetail();
$obj->hydrate($row);
}
return $obj;
}
}
- 以上がGoodsPeerクラス。
- doSelectDetail()メソッド内でdoSelectStmt()を実行し、結...
- populateDetailObjects()で新しいクラスを作成し、そのイン...
** 参考 [#n8cd8a3f]
- http://www.centsys.jp/service/technical_information/sym...
- http://www.propelorm.org/wiki/Documentation/1.3/Upgrading
ページ名: