public static function retrieveByPK($test_schedule_id, $location_id, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $criteria = new Criteria();
     $criteria->add(VTestApplSched2Peer::TEST_SCHEDULE_ID, $test_schedule_id);
     $criteria->add(VTestApplSched2Peer::LOCATION_ID, $location_id);
     $v = VTestApplSched2Peer::doSelect($criteria, $con);
     return !empty($v) ? $v[0] : null;
 }
示例#2
0
 public function getVTestApplSched2s($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseVTestApplSched2Peer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collVTestApplSched2s === null) {
         if ($this->isNew()) {
             $this->collVTestApplSched2s = array();
         } else {
             $criteria->add(VTestApplSched2Peer::LOCATION_ID, $this->getId());
             VTestApplSched2Peer::addSelectColumns($criteria);
             $this->collVTestApplSched2s = VTestApplSched2Peer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(VTestApplSched2Peer::LOCATION_ID, $this->getId());
             VTestApplSched2Peer::addSelectColumns($criteria);
             if (!isset($this->lastVTestApplSched2Criteria) || !$this->lastVTestApplSched2Criteria->equals($criteria)) {
                 $this->collVTestApplSched2s = VTestApplSched2Peer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastVTestApplSched2Criteria = $criteria;
     return $this->collVTestApplSched2s;
 }