/** * Dispatches new comment event. * * @param $username * @param $content * @param $postId */ public function dispatchNewCommentEvent($username, $content, $postId) { $event = new NewCommentEvent(); $event->setAuthorUsername($username); $event->setContent($content); $event->setPostId($postId); $this->getEventDispatcher()->dispatch('application_arferr_blog.event.new_comment', $event); }
/** * @param NewCommentEvent $event */ public function onNewComment(NewCommentEvent $event) { //echo 'crmNotifier, onNewComment'; $this->processRequest($event->toArray()); }