コード例 #1
0
ファイル: Pathway.php プロジェクト: nvidela/kimkelen
 function getPathwayStudentsForYear($year, $criteria = null, PropelPDO $con = null)
 {
     $criteria = PathwayPeer::getCriteriaForPathwayStudents($criteria);
     $criteria->addJoin(StudentPeer::ID, StudentCareerSchoolYearPeer::STUDENT_ID);
     $criteria->add(StudentCareerSchoolYearPeer::YEAR, $year);
     $criteria->add(StudentCareerSchoolYearPeer::CAREER_SCHOOL_YEAR_ID, $this->getSchoolYearId());
     return parent::getPathwayStudentsJoinStudent($criteria, $con, Criteria::INNER_JOIN);
 }
コード例 #2
0
 public function validateSchoolYear($validator, $values)
 {
     $criteria = new Criteria();
     $criteria->add(PathwayPeer::SCHOOL_YEAR_ID, $values['school_year_id']);
     if (PathwayPeer::doCount($criteria) != 0) {
         throw new sfValidatorError($validator, __("Can't create two pathways for the same school year"));
     }
     return $values;
 }
コード例 #3
0
 public function validatePathway($validator, $values)
 {
     $criteria = new Criteria();
     $criteria->add(PathwayPeer::SCHOOL_YEAR_ID, SchoolYearPeer::retrieveCurrent()->getId());
     if (PathwayPeer::doCount($criteria) == 0) {
         throw new sfValidatorError($validator, "No se puede guardar el formulario si no existe una trayectoria para el año lectivo actual.");
     }
     return $values;
 }
コード例 #4
0
ファイル: PathwayPeer.php プロジェクト: nvidela/kimkelen
 public static function retrieveCurrent()
 {
     $c = new Criteria();
     $c->add(PathwayPeer::SCHOOL_YEAR_ID, SchoolYearPeer::retrieveCurrent()->getId(), Criteria::EQUAL);
     return PathwayPeer::doSelectOne($c);
 }
コード例 #5
0
 public function getCourseSubjectStudentPathwayMark()
 {
     $c = new Criteria();
     $c->add(CourseSubjectStudentPathwayPeer::STUDENT_ID, $this->getStudentId());
     $c->add(CourseSubjectStudentPathwayPeer::COURSE_SUBJECT_ID, $this->getCourseSubjectId());
     $c->addJoin(CourseSubjectStudentPathwayPeer::PATHWAY_STUDENT_ID, PathwayStudentPeer::ID, Criteria::INNER_JOIN);
     $c->add(PathwayStudentPeer::PATHWAY_ID, PathwayPeer::retrieveCurrent()->getId());
     return CourseSubjectStudentPathwayPeer::doSelect($c);
 }