Example #1
0
 /**
  * Marks the readable as unread by the current authenticated user
  *
  * @param ReadableInterface $readable
  */
 public function markAsUnread(ReadableInterface $readable)
 {
     $participant = $this->getAuthenticatedParticipant();
     if (!$readable->isReadByParticipant($participant)) {
         return;
     }
     $this->readableManager->markAsUnreadByParticipant($readable, $participant);
     $this->dispatcher->dispatch(FOSMessageEvents::POST_UNREAD, new ReadableEvent($readable));
 }
 /**
  * Tells if this readable (thread or message) is read by the current user
  *
  * @return boolean
  */
 public function isRead(ReadableInterface $readable)
 {
     return $readable->isReadByParticipant($this->getAuthenticatedParticipant());
 }