/** * delete file * $file must have file id. * Notice that the function returns true if file has been already deleted. * * @param XooNIpsOrmFile $file XooNIpsOrmFile object * @return boolean false if file id is empty. */ function deleteFile($file) { $file_id = $file->get('file_id'); if (!file_exists($this->createFilepath($file))) { return true; } if (empty($file_id)) { return false; } if (unlink($this->createFilepath($file))) { return true; } return false; }