예제 #1
0
 /**
  * Class constructor
  *
  */
 private function __construct()
 {
     $this->fileDao = BOL_FileDao::getInstance();
 }
예제 #2
0
 public function moveTemporaryFile($tmpId, $desc)
 {
     $tmp = $this->fileTemporaryDao->findById($tmpId);
     if (!$tmp) {
         return false;
     }
     $tmpFilePath = $this->getTemporaryFilePath($tmp->id);
     $fileService = BOL_FileService::getInstance();
     $file = new BOL_File();
     $file->description = htmlspecialchars(trim($desc));
     $file->addDatetime = time();
     $file->filename = $tmp->filename;
     $file->userId = $tmp->userId;
     BOL_FileDao::getInstance()->save($file);
     try {
         copy($tmpFilePath, $fileService->getFilePath($file->id));
     } catch (Exception $e) {
         $photo = null;
     }
     return $file;
 }