public function fixApproved($con) { $c = new Criteria(); $c->add(StudentApprovedCareerSubjectPeer::MARK, null, Criteria::ISNULL); $school_year = SchoolYearPeer::retrieveByPk(1); foreach (StudentApprovedCareerSubjectPeer::doSelect($c) as $student_approved_career_subject) { $course_subject_student = CourseSubjectStudentPeer::retrieveByStudentApprovedCareerSubject($student_approved_career_subject, $school_year); $mark = $course_subject_student->getCourseResult()->getMark(); $student_approved_career_subject->setMark($mark); $student_approved_career_subject->save($con); } }