You are here

public function CommentStatistics::delete in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/comment/src/CommentStatistics.php \Drupal\comment\CommentStatistics::delete()

Delete comment statistics records for an entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity for which comment statistics should be deleted.

Overrides CommentStatisticsInterface::delete

File

core/modules/comment/src/CommentStatistics.php, line 89
Contains \Drupal\comment\CommentStatistics.

Class

CommentStatistics

Namespace

Drupal\comment

Code

public function delete(EntityInterface $entity) {
  $this->database
    ->delete('comment_entity_statistics')
    ->condition('entity_id', $entity
    ->id())
    ->condition('entity_type', $entity
    ->getEntityTypeId())
    ->execute();
}