Exemplo n.º 1
0
 public function getStudentPersonalitys($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseStudentPersonalityPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collStudentPersonalitys === null) {
         if ($this->isNew()) {
             $this->collStudentPersonalitys = array();
         } else {
             $criteria->add(StudentPersonalityPeer::PERSONALITY_ID, $this->getId());
             StudentPersonalityPeer::addSelectColumns($criteria);
             $this->collStudentPersonalitys = StudentPersonalityPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(StudentPersonalityPeer::PERSONALITY_ID, $this->getId());
             StudentPersonalityPeer::addSelectColumns($criteria);
             if (!isset($this->lastStudentPersonalityCriteria) || !$this->lastStudentPersonalityCriteria->equals($criteria)) {
                 $this->collStudentPersonalitys = StudentPersonalityPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastStudentPersonalityCriteria = $criteria;
     return $this->collStudentPersonalitys;
 }
Exemplo n.º 2
0
 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(StudentPersonalityPeer::ID, $pks, Criteria::IN);
         $objs = StudentPersonalityPeer::doSelect($criteria, $con);
     }
     return $objs;
 }