CommentManagerInterface
interface CommentManagerInterface (View source)
Comment manager contains common functions to manage comment fields.
Constants
| COMMENT_MODE_FLAT |
Comments are displayed in a flat list - expanded. |
| COMMENT_MODE_THREADED |
Comments are displayed as a threaded list - expanded. |
Methods
Utility function to return an array of comment fields.
Creates a comment_body field.
Provides a message if posting comments is forbidden.
Returns the number of new comments available on a given entity for a user.
Details
array
getFields(string $entity_type_id)
Utility function to return an array of comment fields.
addBodyField(string $comment_type)
Creates a comment_body field.
string
forbiddenMessage(EntityInterface $entity, string $field_name)
Provides a message if posting comments is forbidden.
If authenticated users can post comments, a message is returned that prompts the anonymous user to log in (or register, if applicable) that redirects to entity comment form. Otherwise, no message is returned.
int|false
getCountNewComments(EntityInterface $entity, string $field_name = NULL, int $timestamp = 0)
Returns the number of new comments available on a given entity for a user.