summaryrefslogtreecommitdiff
path: root/app/Model/Comment.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/Comment.php
parentcf821e117ce8b937cff7f386a107aaa81ba6bf9b (diff)
Move events handling to Symfony\EventDispatcher
Diffstat (limited to 'app/Model/Comment.php')
-rw-r--r--app/Model/Comment.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/Model/Comment.php b/app/Model/Comment.php
index 3b7dfbc1..a36f2b45 100644
--- a/app/Model/Comment.php
+++ b/app/Model/Comment.php
@@ -2,6 +2,7 @@
namespace Model;
+use Event\CommentEvent;
use SimpleValidator\Validator;
use SimpleValidator\Validators;
@@ -107,7 +108,7 @@ class Comment extends Base
$comment_id = $this->persist(self::TABLE, $values);
if ($comment_id) {
- $this->event->trigger(self::EVENT_CREATE, array('id' => $comment_id) + $values);
+ $this->container['dispatcher']->dispatch(self::EVENT_CREATE, new CommentEvent(array('id' => $comment_id) + $values));
}
return $comment_id;
@@ -127,7 +128,7 @@ class Comment extends Base
->eq('id', $values['id'])
->update(array('comment' => $values['comment']));
- $this->event->trigger(self::EVENT_UPDATE, $values);
+ $this->container['dispatcher']->dispatch(self::EVENT_UPDATE, new CommentEvent($values));
return $result;
}