public function __toString() { if ($this->isBimester()) { $parent = CareerSchoolYearPeriodPeer::retrieveByPk($this->getCareerSchoolYearPeriodId()); return sprintf('%s del %s (%s)', $this->getName(), $parent->getName(), $this->getTermStr()); } return sprintf('%s (%s)', $this->getName(), $this->getTermStr()); }
public function doSave($con = null) { parent::doSave($con); $student = StudentPeer::retrieveByPk($this->getValue('student_id')); $career_school_year_period = CareerSchoolYearPeriodPeer::retrieveByPk($this->getValue('career_school_year_period_id')); $student_career_school_year = StudentCareerSchoolYearPeer::getCurrentForStudentAndCareerSchoolYear($student, $career_school_year_period->getCareerSchoolYear()); $course_subject = CourseSubjectPeer::retrieveByPk($this->getValue('course_subject_id')); $student_free = StudentFreePeer::retrieveByStudentCareerSchoolYearCareerSchoolYearPeriodAndCourse($student_career_school_year, $career_school_year_period, $course_subject); $student_free->setIsFree(false); $student_free->save($con); }