CommentStorage::getNewCommentPageNumber

public CommentStorage::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 comments are att

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::createInstance

public static CommentStorage::createInstance(ContainerInterface $container, EntityTypeInterface $entity_info) Instantiates a new instance of this entity handler. This is a factory method that returns a new instance of this object. The factory should pass any needed dependencies into the constructor of this object, but not the container itself. Every call to this method must return a new instance of this object; that is, it may not implement a singleton. Parameters \Symfony\Component\Dependency

CommentStorage::getChildCids

public CommentStorage::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. Overrides CommentStorageInterface::getChildCids File core/modules/comment/src/CommentStorage.php, line 194 Class CommentStorage Defines the storage handler class for comments. Name

CommentStorage::getMaxThread

public CommentStorage::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. Overrides CommentStorageInterface::getMaxThread File core/modules/comment/src/CommentStorage.php, line 69 Class CommentStorage Defines the storage handler class for comments.

CommentStorage::getDisplayOrdinal

public CommentStorage::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 per page

CommentStorage::getMaxThreadPerThread

public CommentStorage::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. Overrides CommentStorageInterface::getMaxThreadPerThread File core/modules/comment/src/CommentStorage.php, line 83 Class CommentStorage Defines the storage handler class for comments. Namesp

CommentStorage::$currentUser

The current user. Type: \Drupal\Core\Session\AccountInterface File core/modules/comment/src/CommentStorage.php, line 29 Class CommentStorage Defines the storage handler class for comments. Namespace Drupal\comment Code protected $currentUser;

CommentStorage

Defines the storage handler class for comments. This extends the Drupal\Core\Entity\Sql\SqlContentEntityStorage class, adding required special handling for comment entities. Hierarchy class \Drupal\Core\Entity\EntityHandlerBase uses DependencySerializationTrait, StringTranslationTraitclass \Drupal\Core\Entity\EntityStorageBase implements EntityHandlerInterface, EntityStorageInterfaceclass \Drupal\Core\Entity\ContentEntityStorageBase implements ContentEntityStorageInterface, DynamicallyFieldable

CommentManagerInterface::COMMENT_MODE_THREADED

Comments are displayed as a threaded list - expanded. File core/modules/comment/src/CommentManagerInterface.php, line 20 Class CommentManagerInterface Comment manager contains common functions to manage comment fields. Namespace Drupal\comment Code const COMMENT_MODE_THREADED = 1;