From 17dc5bdc9ede52ad618bbf326e67e3b6988170f7 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 27 Dec 2014 19:10:38 -0500 Subject: Move events handling to Symfony\EventDispatcher --- app/Model/TaskDuplication.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'app/Model/TaskDuplication.php') diff --git a/app/Model/TaskDuplication.php b/app/Model/TaskDuplication.php index 2410213b..172edb9f 100644 --- a/app/Model/TaskDuplication.php +++ b/app/Model/TaskDuplication.php @@ -2,6 +2,8 @@ namespace Model; +use Event\TaskEvent; + /** * Task Duplication * @@ -84,7 +86,14 @@ class TaskDuplication extends Base $this->checkDestinationProjectValues($values); - return $this->db->table(Task::TABLE)->eq('id', $task['id'])->update($values); + if ($this->db->table(Task::TABLE)->eq('id', $task['id'])->update($values)) { + $this->container['dispatcher']->dispatch( + Task::EVENT_MOVE_PROJECT, + new TaskEvent(array_merge($task, $values, array('task_id' => $task['id']))) + ); + } + + return true; } /** -- cgit v1.2.3