public function saveJobInterview(JobInterview $jobInterview) { try { if ($jobInterview->getId() == "") { $idGenService = new IDGeneratorService(); $idGenService->setEntity($jobInterview); $jobInterview->setId($idGenService->getNextID()); } $jobInterview->save(); return true; } catch (Exception $e) { throw new DaoException($e->getMessage()); } }
public function testSaveJobInterview() { $newJobInterview = new JobInterview(); $newJobInterview->setInterviewName("HR Interview"); $newJobInterview->setInterviewDate("2011-04-03"); $newJobInterview->setInterviewTime("08:48"); $newJobInterview->setNote("new note"); $newJobInterview->setCandidateVacancyId(2); $newJobInterviewInterviewer = new JobInterviewInterviewer(); $newJobInterviewInterviewer->setInterviewerId(5); $newJobInterviewInterviewer1 = clone $newJobInterviewInterviewer; $newJobInterviewInterviewer1->setInterviewerId(2); $newJobInterview->getJobInterviewInterviewer()->add($newJobInterviewInterviewer); $newJobInterview->getJobInterviewInterviewer()->add($newJobInterviewInterviewer1); $this->assertEquals(null, $newJobInterview->save()); }
public function testSaveJobInterviewForNullId() { TestDataService::truncateTables(array('JobInterview', 'JobInterviewInterviewer', 'JobInterviewAttachment')); $interview = new JobInterview(); $interview->setId(null); $interview->setInterviewName('1st Interview'); $interview->setInterviewDate('2011-05-05'); $return = $this->jobInterviewDao->saveJobInterview($interview); $this->assertTrue($return); }