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; }