function CommentManagerInterface::getCountNewComments
Same name in other branches
- 9 core/modules/comment/src/CommentManagerInterface.php \Drupal\comment\CommentManagerInterface::getCountNewComments()
- 10 core/modules/comment/src/CommentManagerInterface.php \Drupal\comment\CommentManagerInterface::getCountNewComments()
- 11.x 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.
1 method overrides CommentManagerInterface::getCountNewComments()
- CommentManager::getCountNewComments in core/
modules/ comment/ src/ CommentManager.php - Returns the number of new comments available on a given entity for a user.
File
-
core/
modules/ comment/ src/ CommentManagerInterface.php, line 76
Class
- CommentManagerInterface
- Comment manager contains common functions to manage comment fields.
Namespace
Drupal\commentCode
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.