You are here

protected function BundleEntityDuplicator::loadEntities in Entity API 8

Loads config entities with the given ID prefix.

Parameters

string $entity_type_id: The entity type ID.

string $id_prefix: The ID prefix.

Return value

\Drupal\Core\Config\Entity\ConfigEntityInterface[] The loaded config entities.

2 calls to BundleEntityDuplicator::loadEntities()
BundleEntityDuplicator::duplicateDisplays in src/BundleEntityDuplicator.php
Duplicates the bundle entity's view/form displays.
BundleEntityDuplicator::duplicateFields in src/BundleEntityDuplicator.php
Duplicates the bundle entity's fields.

File

src/BundleEntityDuplicator.php, line 118

Class

BundleEntityDuplicator

Namespace

Drupal\entity

Code

protected function loadEntities($entity_type_id, $id_prefix) {
  $storage = $this->entityTypeManager
    ->getStorage($entity_type_id);
  $ids = $storage
    ->getQuery()
    ->condition('id', $id_prefix, 'STARTS_WITH')
    ->execute();
  return $ids ? $storage
    ->loadMultiple($ids) : [];
}