public function getTestApplicantPhotos($criteria = null, $con = null) { include_once 'lib/model/om/BaseTestApplicantPhotoPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collTestApplicantPhotos === null) { if ($this->isNew()) { $this->collTestApplicantPhotos = array(); } else { $criteria->add(TestApplicantPhotoPeer::TEST_APPLICANT_ID, $this->getId()); TestApplicantPhotoPeer::addSelectColumns($criteria); $this->collTestApplicantPhotos = TestApplicantPhotoPeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(TestApplicantPhotoPeer::TEST_APPLICANT_ID, $this->getId()); TestApplicantPhotoPeer::addSelectColumns($criteria); if (!isset($this->lastTestApplicantPhotoCriteria) || !$this->lastTestApplicantPhotoCriteria->equals($criteria)) { $this->collTestApplicantPhotos = TestApplicantPhotoPeer::doSelect($criteria, $con); } } } $this->lastTestApplicantPhotoCriteria = $criteria; return $this->collTestApplicantPhotos; }
public static function doSelectJoinAll(Criteria $c, $con = null) { $c = clone $c; if ($c->getDbName() == Propel::getDefaultDB()) { $c->setDbName(self::DATABASE_NAME); } TestApplicantPhotoPeer::addSelectColumns($c); $startcol2 = TestApplicantPhotoPeer::NUM_COLUMNS - TestApplicantPhotoPeer::NUM_LAZY_LOAD_COLUMNS + 1; TestApplicantPeer::addSelectColumns($c); $startcol3 = $startcol2 + TestApplicantPeer::NUM_COLUMNS; $c->addJoin(TestApplicantPhotoPeer::TEST_APPLICANT_ID, TestApplicantPeer::ID); $rs = BasePeer::doSelect($c, $con); $results = array(); while ($rs->next()) { $omClass = TestApplicantPhotoPeer::getOMClass(); $cls = Propel::import($omClass); $obj1 = new $cls(); $obj1->hydrate($rs); $omClass = TestApplicantPeer::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->getTestApplicant(); if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) { $newObject = false; $temp_obj2->addTestApplicantPhoto($obj1); break; } } if ($newObject) { $obj2->initTestApplicantPhotos(); $obj2->addTestApplicantPhoto($obj1); } $results[] = $obj1; } return $results; }