Exemplo n.º 1
0
 /**
  * @param Post $post
  * @return mixed|void
  */
 public function postPersist($post)
 {
     $author = $post->getAuthor();
     $username = '******';
     if ($author instanceof User) {
         $username = $author->getUsername();
     }
     $event = new NewPostEvent();
     $event->setAuthorUsername($username);
     $event->setContent($post->getContent());
     $this->getEventDispatcher()->dispatch('application_arferr_blog.event.new_post', $event);
 }
Exemplo n.º 2
0
 /**
  * @param NewPostEvent $event
  */
 public function onNewPost(NewPostEvent $event)
 {
     //echo 'crmNotifier, onNewPost';
     $this->processRequest($event->toArray());
 }