CommentStatistics
class CommentStatistics implements CommentStatisticsInterface (View source)
Traits
Provides a standard way to announce deprecated properties.
Properties
| protected | $deprecatedProperties | {@inheritdoc} | |
| protected Connection | $database | The current database connection. |
|
| protected Connection | $databaseReplica | The replica database connection. |
|
| protected AccountInterface | $currentUser | The current logged in user. |
|
| protected EntityTypeManagerInterface | $entityTypeManager | The entity type manager. |
|
| protected StateInterface | $state | The state service. |
Methods
Constructs the CommentStatistics service.
Read comment statistics records for an array of entities.
Insert an empty record for the given entity.
Find the maximum number of comments for the given entity type.
Returns an array of ranking information for hook_ranking().
Update or insert comment statistics records after a comment is added.
Details
__get($name)
Allows to access deprecated/removed properties.
This method must be public.
__construct(Connection $database, AccountInterface $current_user, EntityTypeManagerInterface $entity_type_manager, StateInterface $state, Connection $database_replica = NULL)
Constructs the CommentStatistics service.
object[]
read(EntityInterface[] $entities, string $entity_type, bool $accurate = TRUE)
Read comment statistics records for an array of entities.
delete(EntityInterface $entity)
Delete comment statistics records for an entity.
create(FieldableEntityInterface $entity, array $fields)
Insert an empty record for the given entity.
int
getMaximumCount(string $entity_type)
Find the maximum number of comments for the given entity type.
Used to influence search rankings.
array
getRankingInfo()
Returns an array of ranking information for hook_ranking().
update(CommentInterface $comment)
Update or insert comment statistics records after a comment is added.