Ejemplo n.º 1
0
 public function getVSubjectAccalLectorStudents($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseVSubjectAccalLectorStudentPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collVSubjectAccalLectorStudents === null) {
         if ($this->isNew()) {
             $this->collVSubjectAccalLectorStudents = array();
         } else {
             $criteria->add(VSubjectAccalLectorStudentPeer::EMPLOYEE_ID, $this->getId());
             VSubjectAccalLectorStudentPeer::addSelectColumns($criteria);
             $this->collVSubjectAccalLectorStudents = VSubjectAccalLectorStudentPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(VSubjectAccalLectorStudentPeer::EMPLOYEE_ID, $this->getId());
             VSubjectAccalLectorStudentPeer::addSelectColumns($criteria);
             if (!isset($this->lastVSubjectAccalLectorStudentCriteria) || !$this->lastVSubjectAccalLectorStudentCriteria->equals($criteria)) {
                 $this->collVSubjectAccalLectorStudents = VSubjectAccalLectorStudentPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastVSubjectAccalLectorStudentCriteria = $criteria;
     return $this->collVSubjectAccalLectorStudents;
 }
 public static function retrieveByPK($subject_accal_id, $class_group_id, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $criteria = new Criteria();
     $criteria->add(VSubjectAccalLectorStudentPeer::SUBJECT_ACCAL_ID, $subject_accal_id);
     $criteria->add(VSubjectAccalLectorStudentPeer::CLASS_GROUP_ID, $class_group_id);
     $v = VSubjectAccalLectorStudentPeer::doSelect($criteria, $con);
     return !empty($v) ? $v[0] : null;
 }