CommentStorage::getUnapprovedCount

public CommentStorage::getUnapprovedCount() Returns the number of unapproved comments. Return value int The number of unapproved comments. Overrides CommentStorageInterface::getUnapprovedCount File core/modules/comment/src/CommentStorage.php, line 326 Class CommentStorage Defines the storage handler class for comments. Namespace Drupal\comment Code public function getUnapprovedCount() { return $this->database->select('comment_field_data', 'c') ->condition('status', Comm

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::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::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::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::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::$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::getFields

public CommentManagerInterface::getFields($entity_type_id) Utility function to return an array of comment fields. Parameters string $entity_type_id: The content entity type to which the comment fields are attached. Return value array An array of comment field map definitions, keyed by field name. Each value is an array with two entries: type: The field type. bundles: The bundles in which the field appears, as an array with entity types as keys and the array of bundle names as values. See