protected function createStudentAttendance($student, $day, $course, $absenceType) { $absence = new StudentAttendance(); $absence->setCareerSchoolYearId($course->getCareerSchoolYear()->getId()); $absence->setStudentId($student->getId()); $absence->setDay($day); $absence->setAbsenceTypeId($absenceType->getId()); $absence->setValue($absenceType->getValue()); $absence->save(); return $absence; }