コード例 #1
0
 /**
  * Execute job
  *
  * @param  int    $commentId
  * @param  string $eventName
  * @return $this
  */
 public function execute($commentId, $eventName)
 {
     $event = CommentEventBuilder::getInstance($this->container)->withCommentId($commentId)->buildEvent();
     if ($event !== null) {
         $this->dispatcher->dispatch($eventName, $event);
         if ($eventName === CommentModel::EVENT_CREATE) {
             $this->userMentionModel->fireEvents($event['comment']['comment'], CommentModel::EVENT_USER_MENTION, $event);
         }
     }
 }
コード例 #2
0
ファイル: CommentEventJob.php プロジェクト: phecho/kanboard
 /**
  * Execute job
  *
  * @param  int    $commentId
  * @param  string $eventName
  */
 public function execute($commentId, $eventName)
 {
     $event = CommentEventBuilder::getInstance($this->container)->withCommentId($commentId)->buildEvent();
     if ($event !== null) {
         $this->dispatcher->dispatch($eventName, $event);
         if ($eventName === CommentModel::EVENT_CREATE) {
             $userMentionJob = $this->userMentionJob->withParams($event['comment']['comment'], CommentModel::EVENT_USER_MENTION, $event);
             $this->queueManager->push($userMentionJob);
         }
     }
 }
コード例 #3
0
 /**
  * Get iterator builder
  *
  * @access protected
  * @return EventIteratorBuilder
  */
 protected function getIteratorBuilder()
 {
     $iterator = new EventIteratorBuilder();
     $iterator->withBuilder(TaskEventBuilder::getInstance($this->container))->withBuilder(CommentEventBuilder::getInstance($this->container))->withBuilder(SubtaskEventBuilder::getInstance($this->container))->withBuilder(TaskFileEventBuilder::getInstance($this->container))->withBuilder(TaskLinkEventBuilder::getInstance($this->container));
     return $iterator;
 }