You are here

public function Migrator::getEntityTypesToMigrate in Lightning Workflow 8.3

Same name and namespace in other branches
  1. 8.2 modules/lightning_scheduler/src/Migrator.php \Drupal\lightning_scheduler\Migrator::getEntityTypesToMigrate()

Returns all content entity types which need to be migrated.

Parameters

string[] $limit: (optional) An array of entity type IDs. If given, only those entity types will be considered.

Return value

\Drupal\Core\Entity\EntityTypeInterface[] The entity types that need to be migrated.

File

modules/lightning_scheduler/src/Migrator.php, line 108

Class

Migrator
The migration is not an API and should not be extended or re-used.

Namespace

Drupal\lightning_scheduler

Code

public function getEntityTypesToMigrate(array $limit = []) {

  // Only content entities which have been marked as needing migration are
  // considered.
  $filter = function (EntityTypeInterface $entity_type) {
    return $entity_type
      ->entityClassImplements(ContentEntityInterface::class);
  };
  $entity_types = array_filter($this->entityTypeManager
    ->getDefinitions(), $filter);
  $migrations = $limit ?: $this
    ->getMigrations();
  $migrations = array_flip($migrations);
  return array_intersect_key($entity_types, $migrations);
}