summaryrefslogtreecommitdiff
path: root/app/Model/SubTask.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/SubTask.php
parentcf821e117ce8b937cff7f386a107aaa81ba6bf9b (diff)
Move events handling to Symfony\EventDispatcher
Diffstat (limited to 'app/Model/SubTask.php')
-rw-r--r--app/Model/SubTask.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/Model/SubTask.php b/app/Model/SubTask.php
index f301ad62..12558429 100644
--- a/app/Model/SubTask.php
+++ b/app/Model/SubTask.php
@@ -2,6 +2,7 @@
namespace Model;
+use Event\SubtaskEvent;
use SimpleValidator\Validator;
use SimpleValidator\Validators;
@@ -146,7 +147,10 @@ class SubTask extends Base
$subtask_id = $this->persist(self::TABLE, $values);
if ($subtask_id) {
- $this->event->trigger(self::EVENT_CREATE, array('id' => $subtask_id) + $values);
+ $this->container['dispatcher']->dispatch(
+ self::EVENT_CREATE,
+ new SubtaskEvent(array('id' => $subtask_id) + $values)
+ );
}
return $subtask_id;
@@ -165,7 +169,10 @@ class SubTask extends Base
$result = $this->db->table(self::TABLE)->eq('id', $values['id'])->save($values);
if ($result) {
- $this->event->trigger(self::EVENT_UPDATE, $values);
+ $this->container['dispatcher']->dispatch(
+ self::EVENT_UPDATE,
+ new SubtaskEvent($values)
+ );
}
return $result;