public static function populateObjects(ResultSet $rs) { $results = array(); $cls = AngketpmbSoalPeer::getOMClass(); $cls = Propel::import($cls); while ($rs->next()) { $obj = new $cls(); $obj->hydrate($rs); $results[] = $obj; } return $results; }
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; }