/** * Registers the student to the given $school_year in the given $shift. * * @param SchoolYear $school_year * @param Shift $shift * @param mixed $con * @return void */ public function registerToSchoolYear($school_year, $shift, $con = null) { if ($con == null) { $con = Propel::getConnection(StudentPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); } $school_year_student = new SchoolYearStudent(); $school_year_student->setStudent($this); $school_year_student->setSchoolYear($school_year); $school_year_student->setShift($shift); $school_year_student->save($con); $school_year_student->clearAllReferences(true); unset($school_year_student); }