public function createExaminationSubjectsForYear($year) { $career_subject_school_years = CareerSubjectSchoolYearPeer::retrieveForExaminationAndYear($this, $year); foreach ($career_subject_school_years as $career_subject_school_year) { $examination_subject = new ExaminationSubject(); $examination_subject->setCareerSubjectSchoolYearId($career_subject_school_year->getId()); $this->addExaminationSubject($examination_subject); } }