function CommentStatistics::delete

Same name and namespace in other branches
  1. 9 core/modules/comment/src/CommentStatistics.php \Drupal\comment\CommentStatistics::delete()
  2. 8.9.x core/modules/comment/src/CommentStatistics.php \Drupal\comment\CommentStatistics::delete()
  3. 10 core/modules/comment/src/CommentStatistics.php \Drupal\comment\CommentStatistics::delete()

File

core/modules/comment/src/CommentStatistics.php, line 104

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();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.