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); }
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; }
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; }
public static function retrieveCurrent() { $c = new Criteria(); $c->add(PathwayPeer::SCHOOL_YEAR_ID, SchoolYearPeer::retrieveCurrent()->getId(), Criteria::EQUAL); return PathwayPeer::doSelectOne($c); }
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); }