public static function setAvailableStudentsForCourse(CourseSubject $course_subject)
 {
     $course = $course_subject->getCourse();
     $school_year = $course->getSchoolYear();
     $pathways = $school_year->getPathways();
     $available_pathway_students = array();
     foreach ($pathways as $pathway) {
         $c = new Criteria();
         $c->addJoin(PathwayStudentPeer::STUDENT_ID, StudentCareerSubjectAllowedPathwayPeer::STUDENT_ID);
         $c->add(PathwayStudentPeer::PATHWAY_ID, $pathway->getId());
         $c->add(PathwayStudentPeer::YEAR, $course_subject->getYear());
         $c->add(StudentCareerSubjectAllowedPathwayPeer::CAREER_SUBJECT_ID, $course_subject->getCareerSubjectSchoolYear()->getCareerSubject()->getId());
         foreach (PathwayStudentPeer::doSelect($c) as $ps) {
             $available_pathway_students[] = $ps->getStudent();
         }
     }
     self::$_students = array_merge($course_subject->getPathwayStudents(), $available_pathway_students);
 }
 /**
  * This methods returns the students available four a course that have a Division
  *
  * @see getAvailableStudentsForCourseSubjectCriteria
  *
  * @param CourseSubject $course_subject
  * @param Criteria $criteria
  * @param Boolean $filter_by_orientation
  * @return Criteria
  */
 public function getAvailableStudentsForDivisionCourseSubjectCriteria(CourseSubject $course_subject, $criteria = null, $filter_by_orientation = true)
 {
     $criteria = is_null($criteria) ? new Criteria() : $criteria;
     if ($course_subject->getCourse()->getDivision()) {
         $c = new Criteria();
         $c->add(DivisionStudentPeer::DIVISION_ID, $course_subject->getCourse()->getDivisionId());
         $c->addJoin(StudentPeer::ID, DivisionStudentPeer::STUDENT_ID);
         $c->clearSelectColumns();
         $c->addSelectColumn(StudentPeer::ID);
         $stmt = StudentPeer::doSelectStmt($c);
         $in = $stmt->fetchAll(PDO::FETCH_COLUMN);
         $criteria->addAnd(StudentPeer::ID, $in, Criteria::IN);
     }
     return $this->getAvailableStudentsForCourseSubjectCriteria($course_subject, $criteria, $filter_by_orientation);
 }