public static function doSelectByStudentAll() { $student = StudentPeer::retrieveByPK(sfContext::getInstance()->getRequest()->getParameter('student_id')); if (!$student) { return array(); } $c = new Criteria(); $c->add(VStudentCoursePeer::STUDENT_ID, $student->getId()); return VStudentCoursePeer::doSelect($c); }
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(VStudentCoursePeer::ID, $pks, Criteria::IN); $objs = VStudentCoursePeer::doSelect($criteria, $con); } return $objs; }
public function getVStudentCourses($criteria = null, $con = null) { include_once 'lib/model/om/BaseVStudentCoursePeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collVStudentCourses === null) { if ($this->isNew()) { $this->collVStudentCourses = array(); } else { $criteria->add(VStudentCoursePeer::SUBJECT_CURR_ID, $this->getId()); VStudentCoursePeer::addSelectColumns($criteria); $this->collVStudentCourses = VStudentCoursePeer::doSelect($criteria, $con); } } else { if (!$this->isNew()) { $criteria->add(VStudentCoursePeer::SUBJECT_CURR_ID, $this->getId()); VStudentCoursePeer::addSelectColumns($criteria); if (!isset($this->lastVStudentCourseCriteria) || !$this->lastVStudentCourseCriteria->equals($criteria)) { $this->collVStudentCourses = VStudentCoursePeer::doSelect($criteria, $con); } } } $this->lastVStudentCourseCriteria = $criteria; return $this->collVStudentCourses; }