コード例 #1
0
 /**
  *
  * @param JobVacancyAttachment $attachment
  * @return <type>
  */
 public function saveVacancyAttachment(JobVacancyAttachment $attachment)
 {
     try {
         if ($attachment->getId() == '') {
             $idGenService = new IDGeneratorService();
             $idGenService->setEntity($attachment);
             $attachment->setId($idGenService->getNextID());
         }
         $attachment->save();
         return true;
     } catch (Exception $e) {
         throw new DaoException($e->getMessage());
     }
 }
コード例 #2
0
 /**
  *
  */
 public function testSaveVacancyAttachmentForNullId()
 {
     TestDataService::truncateSpecificTables(array('JobVacancyAttachment'));
     $file = tmpfile();
     fwrite($file, "writing to tempfile");
     fseek($file, 0);
     $resume = new JobVacancyAttachment();
     $resume->setId(null);
     $resume->setVacancyId(1);
     $resume->setFileType('.txt');
     $resume->setFileName('xyz.txt');
     $resume->setFileSize('512');
     $return = $this->recruitmentAttachmentDao->saveVacancyAttachment($resume);
     $this->assertTrue($return);
 }