/** * Construct a grade, belonging to an application. * @param object $grade - API data. * @param {Application} $application - Parent application. */ public function __construct($grade, Application $application) { $this->id = $grade->CijferId; $this->grade = $grade->CijferStr; $this->time = strtotime($grade->DatumIngevoerd); $this->teacher = $grade->Docent; $this->pass = $grade->IsVoldoende; $this->hasExemption = $grade->VakDispensatie || $grade->VakVrijstelling || $grade->Vrijstelling; $this->isValid = $grade->TeltMee; $this->shouldBeDone = $grade->Inhalen; $this->subject = $application->getSubjectById($grade->Vak->Id); }