You are here

protected function EntityExtraFieldListBuilder::getEntityIds in Entity Extra Field 8

Same name and namespace in other branches
  1. 2.0.x src/Controller/EntityExtraFieldListBuilder.php \Drupal\entity_extra_field\Controller\EntityExtraFieldListBuilder::getEntityIds()

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

Return value

array An array of entity IDs.

Overrides EntityListBuilder::getEntityIds

File

src/Controller/EntityExtraFieldListBuilder.php, line 92

Class

EntityExtraFieldListBuilder
Define entity extra field list builder.

Namespace

Drupal\entity_extra_field\Controller

Code

protected function getEntityIds() {
  $query = $this
    ->getStorage()
    ->getQuery();
  if ($base_entity_type_id = $this
    ->getBaseEntityTypeId()) {
    $query
      ->condition('base_entity_type_id', $base_entity_type_id);
  }
  if ($base_entity_bundle_type = $this
    ->getBaseEntityBundleType()) {
    $query
      ->condition('base_bundle_type_id', $base_entity_bundle_type
      ->id());
  }
  $query
    ->sort($this->entityType
    ->getKey('id'));

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