public static function doSelectJoinAllExceptAngketpmbOption(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } AngketpmbSessionAnswerPeer::addSelectColumns($c); $startcol2 = AngketpmbSessionAnswerPeer::NUM_COLUMNS - AngketpmbSessionAnswerPeer::NUM_LAZY_LOAD_COLUMNS + 1; AngketpmbSessionPeer::addSelectColumns($c); $startcol3 = $startcol2 + AngketpmbSessionPeer::NUM_COLUMNS; AngketpmbSoalPeer::addSelectColumns($c); $startcol4 = $startcol3 + AngketpmbSoalPeer::NUM_COLUMNS; $c->addJoin(AngketpmbSessionAnswerPeer::SESSION_ID, AngketpmbSessionPeer::ID); $c->addJoin(AngketpmbSessionAnswerPeer::SOAL_ID, AngketpmbSoalPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = AngketpmbSessionAnswerPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = AngketpmbSessionPeer::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->getAngketpmbSession(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addAngketpmbSessionAnswer($obj1); break; } } if ($newObject) { $obj2->initAngketpmbSessionAnswers(); $obj2->addAngketpmbSessionAnswer($obj1); } $omClass = AngketpmbSoalPeer::getOMClass(); $cls = Propel::import($omClass); $obj3 = new $cls(); $obj3->hydrate($rs, $startcol3); $newObject = true; for ($j = 0, $resCount = count($results); $j < $resCount; $j++) { $temp_obj1 = $results[$j]; $temp_obj3 = $temp_obj1->getAngketpmbSoal(); if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) { $newObject = false; $temp_obj3->addAngketpmbSessionAnswer($obj1); break; } } if ($newObject) { $obj3->initAngketpmbSessionAnswers(); $obj3->addAngketpmbSessionAnswer($obj1); } $results[] = $obj1; } return $results; }
public function getAngketpmbSessionAnswers($criteria = null, $con = null) { include_once 'lib/model/om/BaseAngketpmbSessionAnswerPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collAngketpmbSessionAnswers === null) { if ($this->isNew()) { $this->collAngketpmbSessionAnswers = array(); } else { $criteria->add(AngketpmbSessionAnswerPeer::SESSION_ID, $this->getId()); AngketpmbSessionAnswerPeer::addSelectColumns($criteria); $this->collAngketpmbSessionAnswers = AngketpmbSessionAnswerPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(AngketpmbSessionAnswerPeer::SESSION_ID, $this->getId()); AngketpmbSessionAnswerPeer::addSelectColumns($criteria); if (!isset($this->lastAngketpmbSessionAnswerCriteria) || !$this->lastAngketpmbSessionAnswerCriteria->equals($criteria)) { $this->collAngketpmbSessionAnswers = AngketpmbSessionAnswerPeer::doSelect($criteria, $con); } } } $this->lastAngketpmbSessionAnswerCriteria = $criteria; return $this->collAngketpmbSessionAnswers; }