You are here

protected function TaxonomyEntityIndexUuidDepth::convertIdsToEntityIds in Taxonomy Entity Index 8

Converts the provided IDs to taxonomy term entity IDs.

Parameters

mixed $ids: Either the list of provided IDs or a single item.

Return value

array The list of taxonomy term entity IDs.

Overrides TaxonomyEntityIndexDepth::convertIdsToEntityIds

File

src/Plugin/views/argument/TaxonomyEntityIndexUuidDepth.php, line 53

Class

TaxonomyEntityIndexUuidDepth
Argument handler for entity taxonomy terms with depth, using the UUID.

Namespace

Drupal\taxonomy_entity_index\Plugin\views\argument

Code

protected function convertIdsToEntityIds($ids) {
  if (!is_array($ids)) {
    $ids = [
      $ids,
    ];
  }
  $entity_ids = [];
  $entity_type = $this->termStorage
    ->getEntityTypeId();
  foreach ($ids as $uuid) {
    if (!Uuid::isValid($uuid) || !($entity = $this->entityRepository
      ->loadEntityByUuid($entity_type, $uuid))) {
      continue;
    }
    $entity_ids[] = $entity
      ->id();
  }
  return $entity_ids;
}