CommentStorageInterface::loadThread

public CommentStorageInterface::loadThread(EntityInterface $entity, $field_name, $mode, $comments_per_page = 0, $pager_id = 0) Retrieves comments for a thread, sorted in an order suitable for display. Parameters \Drupal\Core\Entity\EntityInterface $entity: The entity whose comment(s) needs rendering. string $field_name: The field_name whose comment(s) needs rendering. int $mode: The comment display mode: CommentManagerInterface::COMMENT_MODE_FLAT or CommentManagerInterface::COMMENT_MODE_THREAD

CommentStorageInterface::getUnapprovedCount

public CommentStorageInterface::getUnapprovedCount() Returns the number of unapproved comments. Return value int The number of unapproved comments. File core/modules/comment/src/CommentStorageInterface.php, line 111 Class CommentStorageInterface Defines an interface for comment entity storage classes. Namespace Drupal\comment Code public function getUnapprovedCount();

CommentStorageInterface::getNewCommentPageNumber

public CommentStorageInterface::getNewCommentPageNumber($total_comments, $new_comments, FieldableEntityInterface $entity, $field_name) Calculates the page number for the first new comment. Parameters int $total_comments: The total number of comments that the entity has. int $new_comments: The number of new comments that the entity has. \Drupal\Core\Entity\FieldableEntityInterface $entity: The entity to which the comments belong. string $field_name: The field name on the entity to which comment

CommentStorageInterface::getMaxThreadPerThread

public CommentStorageInterface::getMaxThreadPerThread(CommentInterface $comment) Gets the maximum encoded thread value for the children of this comment. Parameters \Drupal\comment\CommentInterface $comment: A comment entity. Return value string The maximum encoded thread value among all replies of $comment. File core/modules/comment/src/CommentStorageInterface.php, line 35 Class CommentStorageInterface Defines an interface for comment entity storage classes. Namespace Drupal\comment

CommentStorageInterface::getMaxThread

public CommentStorageInterface::getMaxThread(CommentInterface $comment) Gets the maximum encoded thread value for the top level comments. Parameters \Drupal\comment\CommentInterface $comment: A comment entity. Return value string The maximum encoded thread value among the top level comments of the node $comment belongs to. File core/modules/comment/src/CommentStorageInterface.php, line 24 Class CommentStorageInterface Defines an interface for comment entity storage classes. Namespace

CommentStorageInterface::getDisplayOrdinal

public CommentStorageInterface::getDisplayOrdinal(CommentInterface $comment, $comment_mode, $divisor = 1) Gets the display ordinal or page number for a comment. Parameters \Drupal\comment\CommentInterface $comment: The comment to use as a reference point. int $comment_mode: The comment display mode: CommentManagerInterface::COMMENT_MODE_FLAT or CommentManagerInterface::COMMENT_MODE_THREADED. int $divisor: Defaults to 1, which returns the display ordinal for a comment. If the number of comments

CommentStorageInterface::getChildCids

public CommentStorageInterface::getChildCids(array $comments) Gets the comment ids of the passed comment entities' children. Parameters \Drupal\comment\CommentInterface[] $comments: An array of comment entities keyed by their ids. Return value array The entity ids of the passed comment entities' children as an array. File core/modules/comment/src/CommentStorageInterface.php, line 81 Class CommentStorageInterface Defines an interface for comment entity storage classes. Namespace Drupal

CommentStorageInterface

Defines an interface for comment entity storage classes. Hierarchy interface \Drupal\Core\Entity\EntityStorageInterfaceinterface \Drupal\Core\Entity\ContentEntityStorageInterfaceinterface \Drupal\comment\CommentStorageInterface File core/modules/comment/src/CommentStorageInterface.php, line 12 Namespace Drupal\comment Members Name Modifiers Type Description CommentStorageInterface::getChildCids public function Gets the comment ids of the passed comment entities' childr

CommentStorage::__construct

public CommentStorage::__construct(EntityTypeInterface $entity_info, Connection $database, EntityManagerInterface $entity_manager, AccountInterface $current_user, CacheBackendInterface $cache, LanguageManagerInterface $language_manager) Constructs a CommentStorage object. Parameters \Drupal\Core\Entity\EntityTypeInterface $entity_info: An array of entity info for the entity type. \Drupal\Core\Database\Connection $database: The database connection to be used. \Drupal\Core\Entity\EntityManagerIn

CommentStorage::loadThread

public CommentStorage::loadThread(EntityInterface $entity, $field_name, $mode, $comments_per_page = 0, $pager_id = 0) To display threaded comments in the correct order we keep a 'thread' field and order by that value. This field keeps this data in a way which is easy to update and convenient to use. A "thread" value starts at "1". If we add a child (A) to this comment, we assign it a "thread" = "1.1". A child of (A) will have "1.1.1". Next brother of (A) will get "1.2". Next brother of the par