public function createStudentCareerSchoolYear(PropelPDO $con) { $c = new Criteria(); $c->addJoin(SchoolYearPeer::ID, SchoolYearStudentPeer::SCHOOL_YEAR_ID); $c->add(SchoolYearPeer::IS_ACTIVE, true); $c->add(SchoolYearStudentPeer::STUDENT_ID, $this->getStudentId()); $school_year_student = SchoolYearStudentPeer::doSelectOne($c, $con); if ($school_year_student) { $career_school_year = $this->getCareer()->getCareerSchoolYear($school_year_student->getSchoolYear($con)); if ($career_school_year && StudentCareerSchoolYearPeer::countByCareerAndStudent($this->getCareerId(), $this->getStudentId(), $school_year_student->getSchoolYearId(), $con) == 0) { $student_career_school_year = new StudentCareerSchoolYear(); $student_career_school_year->setCareerSchoolYearId($career_school_year->getId()); $student_career_school_year->setStudentId($this->getStudentId()); $student_career_school_year->setYear($this->suggestYear()); $student_career_school_year->save($con); } } }
public function getHealthInfoString() { $school_year = SchoolYearPeer::retrieveCurrent(); $c = new Criteria(); $c->add(SchoolYearStudentPeer::STUDENT_ID, $this->getId()); $c->add(SchoolYearStudentPeer::SCHOOL_YEAR_ID, $school_year->getId()); $school_year_student = SchoolYearStudentPeer::doSelectOne($c); SchoolYearStudentPeer::clearInstancePool(); return is_null($school_year_student) ? ' ' : $school_year_student->getHealthInfo(); }