コード例 #1
0
 /**
  * returns the number of unread comments for the currently logged in user
  * on the given file or directory node
  *
  * @param Node $node
  * @return Int|null
  */
 public function getUnreadCount(Node $node)
 {
     $user = $this->userSession->getUser();
     if (is_null($user)) {
         return null;
     }
     $lastRead = $this->commentsManager->getReadMark('files', strval($node->getId()), $user);
     return $this->commentsManager->getNumberOfCommentsForObject('files', strval($node->getId()), $lastRead);
 }