You are here

public function CommentStorage::getChildCids in Zircon Profile 8

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

Gets the comment ids of the passed comment entities' children.

Parameters

\Drupal\comment\CommentInterface[] $comments: An array of comment entities keyed by their ids.

Return value

array The entity ids of the passed comment entities' children as an array.

Overrides CommentStorageInterface::getChildCids

File

core/modules/comment/src/CommentStorage.php, line 199
Contains \Drupal\comment\CommentStorage.

Class

CommentStorage
Defines the controller class for comments.

Namespace

Drupal\comment

Code

public function getChildCids(array $comments) {
  return $this->database
    ->select('comment_field_data', 'c')
    ->fields('c', array(
    'cid',
  ))
    ->condition('pid', array_keys($comments), 'IN')
    ->condition('default_langcode', 1)
    ->execute()
    ->fetchCol();
}