summaryrefslogtreecommitdiff
path: root/app/Model/File.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-12-27 19:10:38 -0500
committerFrédéric Guillot <fred@kanboard.net>2014-12-27 19:10:38 -0500
commit17dc5bdc9ede52ad618bbf326e67e3b6988170f7 (patch)
tree9cf4d325667f11fa735bca84042fb385e3273329 /app/Model/File.php
parentcf821e117ce8b937cff7f386a107aaa81ba6bf9b (diff)
Move events handling to Symfony\EventDispatcher
Diffstat (limited to 'app/Model/File.php')
-rw-r--r--app/Model/File.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/Model/File.php b/app/Model/File.php
index d5a0c7cd..20fba9bf 100644
--- a/app/Model/File.php
+++ b/app/Model/File.php
@@ -2,6 +2,8 @@
namespace Model;
+use Event\FileEvent;
+
/**
* File model
*
@@ -89,7 +91,10 @@ class File extends Base
*/
public function create($task_id, $name, $path, $is_image)
{
- $this->event->trigger(self::EVENT_CREATE, array('task_id' => $task_id, 'name' => $name));
+ $this->container['dispatcher']->dispatch(
+ self::EVENT_CREATE,
+ new FileEvent(array('task_id' => $task_id, 'name' => $name))
+ );
return $this->db->table(self::TABLE)->save(array(
'task_id' => $task_id,