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 getWiki() { $wiki = nahoWikiWikiPeer::retrieveByModelId('project', $this->getId()); if ($wiki == null) { $wiki = new nahoWikiWiki(); $wiki->setModel('project'); $wiki->setModelId($this->getId()); $wiki->setTitle($this->getTitle() . ' Wiki'); $wiki->save(); } return $wiki; }
public function getnahoWikiWiki($con = null) { if ($this->anahoWikiWiki === null && $this->wiki_id !== null) { include_once 'plugins/nahoWikiPlugin/lib/model/om/BasenahoWikiWikiPeer.php'; $this->anahoWikiWiki = nahoWikiWikiPeer::retrieveByPK($this->wiki_id, $con); } return $this->anahoWikiWiki; }
public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(nahoWikiWikiPeer::ID, $pks, Criteria::IN); $objs = nahoWikiWikiPeer::doSelect($criteria, $con); } return $objs; }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = nahoWikiWikiPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setUuid($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setTitle($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setSlug($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setModel($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setModelId($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setStandalone($arr[$keys[6]]); } if (array_key_exists($keys[7], $arr)) { $this->setCreatedAt($arr[$keys[7]]); } }