public function __construct(Post $post)
 {
     $this->blog = $post->getBlog();
     $this->post = $post;
     $this->details = array('post' => array('blog' => $this->blog->getId(), 'title' => $post->getTitle(), 'slug' => $post->getSlug(), 'published' => $post->isPublished(), 'author' => $post->getAuthor()->getFirstName() . ' ' . $post->getAuthor()->getLastName(), 'authorId' => $post->getAuthor()->getId()));
     parent::__construct($this->blog->getResourceNode(), $this->details);
 }
 /**
  * @param Post    $post
  * @param Comment $comment
  */
 public function __construct(Post $post, Comment $comment, $changeSet)
 {
     $this->blog = $post->getBlog();
     $this->comment = $comment;
     $this->post = $post;
     $this->details = array('post' => array('blog' => $this->blog->getId(), 'title' => $post->getTitle(), 'slug' => $post->getSlug()), 'comment' => array('id' => $comment->getId(), 'content' => $comment->getMessage(), 'changeSet' => $changeSet, 'published' => $comment->isPublished(), 'author' => $comment->getAuthor()->getFirstName() . " " . $post->getAuthor()->getLastName(), 'authorId' => $comment->getAuthor()->getId()));
     parent::__construct($this->blog->getResourceNode(), $this->details);
 }
Пример #3
0
 public function postPersist(Post $post, LifecycleEventArgs $event)
 {
     $userPicker = $post->getUserPicker();
     $blog = $post->getBlog();
     if ($post->isPublished() && $userPicker !== null && count($userPicker->getUserIds()) > 0 && $blog->getResourceNode() !== null) {
         $details = array('post' => array('blog' => $blog->getId(), 'title' => $post->getTitle(), 'slug' => $post->getSlug(), 'published' => $post->isPublished(), 'author' => $post->getAuthor()->getFirstName() . ' ' . $post->getAuthor()->getLastName(), 'authorId' => $post->getAuthor()->getId()), 'resource' => array('id' => $blog->getId(), 'name' => $blog->getResourceNode()->getName(), 'type' => $blog->getResourceNode()->getResourceType()->getName()));
         $notification = $this->notificationManager->createNotification('resource-icap_blog-post-user_tagged', 'blog', $blog->getResourceNode()->getId(), $details);
         $this->notificationManager->notifyUsers($notification, $userPicker->getUserIds());
     }
 }
 /**
  * @param Post    $post
  * @param Comment $comment
  */
 public function __construct(Post $post, Comment $comment)
 {
     $author = $comment->getAuthor();
     $blog = $post->getBlog();
     if (null === $author) {
         $author = "Anonyme";
     } else {
         $author = $comment->getAuthor()->getFirstName() . ' ' . $comment->getAuthor()->getLastName();
     }
     $details = array('post' => array('blog' => $blog->getId(), 'title' => $post->getTitle(), 'slug' => $post->getSlug()), 'comment' => array('id' => $comment->getId(), 'author' => $author, 'content' => $comment->getMessage()));
     parent::__construct($blog->getResourceNode(), $details);
 }
 /**
  * @param Post $post
  */
 public function __construct(Post $post)
 {
     $blog = $post->getBlog();
     $details = array('post' => array('blog' => $blog->getId(), 'title' => $post->getTitle(), 'slug' => $post->getSlug(), 'author' => $post->getAuthor()->getFirstName() . ' ' . $post->getAuthor()->getLastName()));
     parent::__construct($blog->getResourceNode(), $details);
 }