diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-12-27 19:10:38 -0500 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-12-27 19:10:38 -0500 |
commit | 17dc5bdc9ede52ad618bbf326e67e3b6988170f7 (patch) | |
tree | 9cf4d325667f11fa735bca84042fb385e3273329 /app/Model/TaskModification.php | |
parent | cf821e117ce8b937cff7f386a107aaa81ba6bf9b (diff) |
Move events handling to Symfony\EventDispatcher
Diffstat (limited to 'app/Model/TaskModification.php')
-rw-r--r-- | app/Model/TaskModification.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/Model/TaskModification.php b/app/Model/TaskModification.php index b165ea24..dac52334 100644 --- a/app/Model/TaskModification.php +++ b/app/Model/TaskModification.php @@ -2,6 +2,8 @@ namespace Model; +use Event\TaskEvent; + /** * Task Modification * @@ -15,17 +17,16 @@ class TaskModification extends Base * * @access public * @param array $values - * @param boolean $fire_events * @return boolean */ - public function update(array $values, $fire_events = true) + public function update(array $values) { $original_task = $this->taskFinder->getById($values['id']); $this->prepare($values); $result = $this->db->table(Task::TABLE)->eq('id', $original_task['id'])->update($values); - if ($result && $fire_events) { + if ($result) { $this->fireEvents($original_task, $values); } @@ -51,7 +52,7 @@ class TaskModification extends Base } foreach ($events as $event) { - $this->event->trigger($event, $event_data); + $this->container['dispatcher']->dispatch($event, new TaskEvent($event_data)); } } |