Write log entry on file removal

This commit is contained in:
Michael
2018-10-16 01:39:42 +01:00
committed by fguillot
parent 00228ac12f
commit cc81f9d4f5
7 changed files with 59 additions and 0 deletions

View File

@@ -51,6 +51,15 @@ abstract class FileModel extends Base
*/
abstract protected function fireCreationEvent($file_id);
/**
* Fire file destruction event
*
* @abstract
* @access protected
* @param integer $file_id
*/
abstract protected function fireDestructionEvent($file_id);
/**
* Get PicoDb query to get all files
*
@@ -187,6 +196,8 @@ abstract class FileModel extends Base
public function remove($file_id)
{
try {
$this->fireDestructionEvent($file_id);
$file = $this->getById($file_id);
$this->objectStorage->remove($file['path']);