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', CommentInterface::NOT_PUBLISHED, '=')
    ->condition('default_langcode', 1)
    ->countQuery()
    ->execute()
    ->fetchField();
}
doc_Drupal
2016-10-29 08:51:01
Comments
Leave a Comment

Please login to continue.