summaryrefslogtreecommitdiff
path: root/app/Model/Comment.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Model/Comment.php')
-rw-r--r--app/Model/Comment.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/Model/Comment.php b/app/Model/Comment.php
index f60a96e3..71e964dc 100644
--- a/app/Model/Comment.php
+++ b/app/Model/Comment.php
@@ -26,8 +26,9 @@ class Comment extends Base
*
* @var string
*/
- const EVENT_UPDATE = 'comment.update';
- const EVENT_CREATE = 'comment.create';
+ const EVENT_UPDATE = 'comment.update';
+ const EVENT_CREATE = 'comment.create';
+ const EVENT_USER_MENTION = 'comment.user.mention';
/**
* Get all comments for a given task
@@ -110,7 +111,9 @@ class Comment extends Base
$comment_id = $this->persist(self::TABLE, $values);
if ($comment_id) {
- $this->container['dispatcher']->dispatch(self::EVENT_CREATE, new CommentEvent(array('id' => $comment_id) + $values));
+ $event = new CommentEvent(array('id' => $comment_id) + $values);
+ $this->dispatcher->dispatch(self::EVENT_CREATE, $event);
+ $this->userMention->fireEvents($values['comment'], self::EVENT_USER_MENTION, $event);
}
return $comment_id;