public static function doSelectRS(Criteria $criteria, $con = null) { foreach (sfMixer::getCallables('BasenahoWikiPagePeer:addDoSelectRS:addDoSelectRS') as $callable) { call_user_func($callable, 'BasenahoWikiPagePeer', $criteria, $con); } if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } if (!$criteria->getSelectColumns()) { $criteria = clone $criteria; nahoWikiPagePeer::addSelectColumns($criteria); } $criteria->setDbName(self::DATABASE_NAME); return BasePeer::doSelect($criteria, $con); }
public static function doSelectJoinAll(Criteria $c, $con = null) { foreach (sfMixer::getCallables('BasenahoWikiPagePeer:doSelectJoinAll:doSelectJoinAll') as $callable) { call_user_func($callable, 'BasenahoWikiPagePeer', $c, $con); } $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } nahoWikiPagePeer::addSelectColumns($c); $startcol2 = nahoWikiPagePeer::NUM_COLUMNS - nahoWikiPagePeer::NUM_LAZY_LOAD_COLUMNS + 1; nahoWikiWikiPeer::addSelectColumns($c); $startcol3 = $startcol2 + nahoWikiWikiPeer::NUM_COLUMNS; $c->addJoin(nahoWikiPagePeer::WIKI_ID, nahoWikiWikiPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = nahoWikiPagePeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = nahoWikiWikiPeer::getOMClass(); $cls = Propel::import($omClass); $obj2 = new $cls(); $obj2->hydrate($rs, $startcol2); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj2 = $temp_obj1->getnahoWikiWiki(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addnahoWikiPage($obj1); break; } } if ($newObject) { $obj2->initnahoWikiPages(); $obj2->addnahoWikiPage($obj1); } $results[] = $obj1; } return $results; }
public function getnahoWikiPages($criteria = null, $con = null) { include_once 'lib/model/om/BasenahoWikiPagePeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collnahoWikiPages === null) { if ($this->isNew()) { $this->collnahoWikiPages = array(); } else { $criteria->add(nahoWikiPagePeer::WIKI_ID, $this->getId()); nahoWikiPagePeer::addSelectColumns($criteria); $this->collnahoWikiPages = nahoWikiPagePeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(nahoWikiPagePeer::WIKI_ID, $this->getId()); nahoWikiPagePeer::addSelectColumns($criteria); if (!isset($this->lastnahoWikiPageCriteria) || !$this->lastnahoWikiPageCriteria->equals($criteria)) { $this->collnahoWikiPages = nahoWikiPagePeer::doSelect($criteria, $con); } } } $this->lastnahoWikiPageCriteria = $criteria; return $this->collnahoWikiPages; }