File events refactoring

This commit is contained in:
Frederic Guillot
2016-07-17 18:47:06 -04:00
parent ec0ecc5b03
commit cbe52e5720
21 changed files with 398 additions and 74 deletions

View File

@@ -60,18 +60,6 @@ class TaskFileModel extends FileModel
return 'tasks';
}
/**
* Get event name
*
* @abstract
* @access protected
* @return string
*/
protected function getEventName()
{
return self::EVENT_CREATE;
}
/**
* Get projectId from fileId
*
@@ -101,4 +89,15 @@ class TaskFileModel extends FileModel
$original_filename = e('Screenshot taken %s', $this->helper->dt->datetime(time())).'.png';
return $this->uploadContent($task_id, $original_filename, $blob);
}
/**
* Fire file creation event
*
* @access protected
* @param integer $file_id
*/
protected function fireCreationEvent($file_id)
{
$this->queueManager->push($this->taskFileEventJob->withParams($file_id, self::EVENT_CREATE));
}
}