Exemple #1
0
 public function getVTestApplScheds($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseVTestApplSchedPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collVTestApplScheds === null) {
         if ($this->isNew()) {
             $this->collVTestApplScheds = array();
         } else {
             $criteria->add(VTestApplSchedPeer::TEST_APPLICANT_ID, $this->getId());
             VTestApplSchedPeer::addSelectColumns($criteria);
             $this->collVTestApplScheds = VTestApplSchedPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(VTestApplSchedPeer::TEST_APPLICANT_ID, $this->getId());
             VTestApplSchedPeer::addSelectColumns($criteria);
             if (!isset($this->lastVTestApplSchedCriteria) || !$this->lastVTestApplSchedCriteria->equals($criteria)) {
                 $this->collVTestApplScheds = VTestApplSchedPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastVTestApplSchedCriteria = $criteria;
     return $this->collVTestApplScheds;
 }
 public static function doSelectJoinAllExceptLocationRelatedByLocation2(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     VTestApplSchedPeer::addSelectColumns($c);
     $startcol2 = VTestApplSchedPeer::NUM_COLUMNS - VTestApplSchedPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     TestApplicantPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + TestApplicantPeer::NUM_COLUMNS;
     TestSchedulePeer::addSelectColumns($c);
     $startcol4 = $startcol3 + TestSchedulePeer::NUM_COLUMNS;
     $c->addJoin(VTestApplSchedPeer::TEST_APPLICANT_ID, TestApplicantPeer::ID);
     $c->addJoin(VTestApplSchedPeer::TEST_SCHEDULE_ID, TestSchedulePeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = VTestApplSchedPeer::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->addVTestApplSched($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initVTestApplScheds();
             $obj2->addVTestApplSched($obj1);
         }
         $omClass = TestSchedulePeer::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->getTestSchedule();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addVTestApplSched($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initVTestApplScheds();
             $obj3->addVTestApplSched($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Exemple #3
0
 public function getVTestApplSchedsRelatedByLocation2($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseVTestApplSchedPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collVTestApplSchedsRelatedByLocation2 === null) {
         if ($this->isNew()) {
             $this->collVTestApplSchedsRelatedByLocation2 = array();
         } else {
             $criteria->add(VTestApplSchedPeer::LOCATION2, $this->getId());
             VTestApplSchedPeer::addSelectColumns($criteria);
             $this->collVTestApplSchedsRelatedByLocation2 = VTestApplSchedPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(VTestApplSchedPeer::LOCATION2, $this->getId());
             VTestApplSchedPeer::addSelectColumns($criteria);
             if (!isset($this->lastVTestApplSchedRelatedByLocation2Criteria) || !$this->lastVTestApplSchedRelatedByLocation2Criteria->equals($criteria)) {
                 $this->collVTestApplSchedsRelatedByLocation2 = VTestApplSchedPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastVTestApplSchedRelatedByLocation2Criteria = $criteria;
     return $this->collVTestApplSchedsRelatedByLocation2;
 }