コード例 #1
0
 private static function getStudentProfile(MongoId $studentId)
 {
     $name = StudentModel::getName($studentId);
     $profile = StudentProfile::getProfile($studentId)->getData();
     if (is_null($profile)) {
         $profile = [];
     }
     $profile['name'] = $name;
     return $profile;
 }
コード例 #2
0
 public static function submit(MongoId $applicationId)
 {
     $applicationData = ApplicationModel::getById($applicationId);
     $application = new ApplicationStudent($applicationData);
     // We need to attach the student profile. If resume is not set, we cannot
     // submit.
     $studentId = $application->getStudentId();
     $studentProfile = StudentProfile::getProfile($studentId);
     if (empty($studentProfile->getData()) || empty($studentProfile->getResume())) {
         return false;
     }
     // Mark the application as submitted.
     ApplicationModel::submitWithStudentProfile($applicationId, $studentProfile);
     self::saveStudentAnswers($application);
     return true;
 }