function CommentManagerInterface::getCountNewComments

Same name in other branches
  1. 9 core/modules/comment/src/CommentManagerInterface.php \Drupal\comment\CommentManagerInterface::getCountNewComments()
  2. 8.9.x core/modules/comment/src/CommentManagerInterface.php \Drupal\comment\CommentManagerInterface::getCountNewComments()
  3. 10 core/modules/comment/src/CommentManagerInterface.php \Drupal\comment\CommentManagerInterface::getCountNewComments()

Returns the number of new comments available on a given entity for a user.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to which the comments are attached to.

string $field_name: (optional) The field_name to count comments for. Defaults to any field.

int $timestamp: (optional) Time to count from. Defaults to time of last user access the entity.

Return value

int|false The number of new comments or FALSE if the user is not authenticated.

File

core/modules/comment/src/CommentManagerInterface.php, line 76

Class

CommentManagerInterface
Comment manager contains common functions to manage comment fields.

Namespace

Drupal\comment

Code

public function getCountNewComments(EntityInterface $entity, $field_name = NULL, $timestamp = 0);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.