summaryrefslogtreecommitdiff
path: root/app/Model/SubTask.php
diff options
context:
space:
mode:
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;