Beispiel #1
0
 public function getThesisAdvisors($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseThesisAdvisorPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collThesisAdvisors === null) {
         if ($this->isNew()) {
             $this->collThesisAdvisors = array();
         } else {
             $criteria->add(ThesisAdvisorPeer::EMPLOYEE_ID, $this->getId());
             ThesisAdvisorPeer::addSelectColumns($criteria);
             $this->collThesisAdvisors = ThesisAdvisorPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(ThesisAdvisorPeer::EMPLOYEE_ID, $this->getId());
             ThesisAdvisorPeer::addSelectColumns($criteria);
             if (!isset($this->lastThesisAdvisorCriteria) || !$this->lastThesisAdvisorCriteria->equals($criteria)) {
                 $this->collThesisAdvisors = ThesisAdvisorPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastThesisAdvisorCriteria = $criteria;
     return $this->collThesisAdvisors;
 }
 public static function retrieveByPKs($pks, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria();
         $criteria->add(ThesisAdvisorPeer::ID, $pks, Criteria::IN);
         $objs = ThesisAdvisorPeer::doSelect($criteria, $con);
     }
     return $objs;
 }