Ejemplo n.º 1
0
 /**
  * This method returns all the free studens of the student in this year.
  * Depending of the configuration of the course , if has day attendance or course_subject attendance
  */
 public function getStudentFrees()
 {
     $c = new Criteria();
     $c->add(StudentFreePeer::STUDENT_ID, $this->getStudentId());
     $c->add(StudentFreePeer::IS_FREE, true);
     if ($this->getCourseSubject()->hasAttendanceForSubject()) {
         $c->add(StudentFreePeer::COURSE_SUBJECT_ID, $this->getCourseSubjectId());
     }
     //else
     //{
     //$c->add(StudentFreePeer::COURSE_SUBJECT_ID, null, Criteria::ISNULL);
     //}
     return StudentFreePeer::doSelect($c);
 }