You are here

public function CommentStorage::getUnapprovedCount in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/comment/src/CommentStorage.php \Drupal\comment\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 331
Contains \Drupal\comment\CommentStorage.

Class

CommentStorage
Defines the controller class for comments.

Namespace

Drupal\comment

Code

public function getUnapprovedCount() {
  return $this->database
    ->select('comment_field_data', 'c')
    ->condition('status', CommentInterface::NOT_PUBLISHED, '=')
    ->condition('default_langcode', 1)
    ->countQuery()
    ->execute()
    ->fetchField();
}