/** * StudentModel constructor. * @param Student $student * @param boolean $buildWithFullInfo */ public function __construct(Student $student, $buildWithFullInfo = false) { $this->setId($student->getId()); $this->setFirstName($student->getFirstName()); $this->setLastName($student->getLastName()); $this->setEmail($student->getEmail()); $this->setFacultyNumber($student->getFacultyNumber()); $this->setEducationForm($student->getEducationForm()); $this->setCourseName($student->getCourse()->getName()); $this->setSpecialityName($student->getSpeciality()->getSpecialityLongName()); $this->setShortSpecialityName($student->getSpeciality()->getSpecialityShortName()); if ($buildWithFullInfo) { foreach ($student->getStudentAssessments() as $studentAssessment) { $this->studentAssessments[$studentAssessment->getSubject()->getId()] = new StudentAssessmentModel($studentAssessment); } } }