diff options
Diffstat (limited to 'app/Model/Comment.php')
-rw-r--r-- | app/Model/Comment.php | 5 |
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; } |