You are here

protected function WebformNodeReferencesListController::getEntityIds in Webform 8.5

Same name and namespace in other branches
  1. 6.x modules/webform_node/src/Controller/WebformNodeReferencesListController.php \Drupal\webform_node\Controller\WebformNodeReferencesListController::getEntityIds()

Loads entity IDs using a pager sorted by the entity id.

Return value

array An array of entity IDs.

Overrides EntityListBuilder::getEntityIds

File

modules/webform_node/src/Controller/WebformNodeReferencesListController.php, line 459

Class

WebformNodeReferencesListController
Defines a controller for webform node references.

Namespace

Drupal\webform_node\Controller

Code

protected function getEntityIds() {
  $query = $this
    ->getStorage()
    ->getQuery()
    ->sort($this->entityType
    ->getKey('id'));

  // Add field names.
  $or = $query
    ->orConditionGroup();
  foreach ($this->fieldNames as $field_name) {
    $or
      ->condition($field_name . '.target_id', $this->webform
      ->id());
  }
  $query
    ->condition($or);

  // Only add the pager if a limit is specified.
  if ($this->limit) {
    $query
      ->pager($this->limit);
  }
  return $query
    ->execute();
}