/** * Class constructor * */ private function __construct() { $this->fileDao = BOL_FileDao::getInstance(); }
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; }