public static function validateEducation(Entity\Education $object, ExecutionContextInterface $context)
 {
     if ($object->isFastTrackScheme()) {
         $context->validate($object, '', 'CsrFastTrackScheme', true);
     }
     if (!$object->isInServiceRoute()) {
         $context->validate($object, '', 'CsrNotInServiceRoute', true);
     }
     if ($object->hasEarlyIntern()) {
         $context->validate($object, '', 'CsrEarlyIntern', true);
     }
     if ($object->hasSummerIntern()) {
         $context->validate($object, '', 'CsrSummerIntern', true);
     }
     if ($object->hasPostgraduateDegree()) {
         self::$runValidatePostgradDegree = true;
     }
     if ($object->hasUndergraduateDegree()) {
         self::$runValidateUndergradDegree = true;
     }
 }
 public function mergeAndPersistApplicantEducation($id, Education $education)
 {
     $existingApplicant = $this->fetchApplicant($id);
     $existingApplicant->getEducation()->setExistingCivilServant($education->isExistingCivilServant());
     $existingApplicant->getEducation()->setFastTrackScheme($education->isFastTrackScheme());
     $existingApplicant->getEducation()->setSchemeName($education->getSchemeName());
     $existingApplicant->getEducation()->setYearOfCompletion($education->getYearOfCompletion());
     $existingApplicant->getEducation()->setInServiceRoute($education->isInServiceRoute());
     $existingApplicant->getEducation()->setUndergraduateDegree($education->hasUndergraduateDegree());
     $existingApplicant->getEducation()->setPostgraduateDegree($education->hasPostgraduateDegree());
     $existingApplicant->getEducation()->setEarlyIntern($education->hasEarlyIntern());
     $existingApplicant->getEducation()->setEarlyInternCompleted($education->getEarlyInternCompleted());
     $existingApplicant->getEducation()->setEarlyInternDept($education->getEarlyInternDept());
     $existingApplicant->getEducation()->setSummerIntern($education->hasSummerIntern());
     $existingApplicant->getEducation()->setSummerInternCompleted($education->getSummerInternCompleted());
     $existingApplicant->getEducation()->setSummerInternDept($education->getSummerInternDept());
     $this->persistApplicant($existingApplicant);
 }