You are here

public function ContentEntityDeriver::getDerivativeDefinitions in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntityDeriver.php \Drupal\migrate_drupal\Plugin\migrate\source\ContentEntityDeriver::getDerivativeDefinitions()

Gets the definition of all derivatives of a base plugin.

Parameters

array $base_plugin_definition: The definition array of the base plugin.

Return value

array An array of full derivative definitions keyed on derivative id.

Overrides DeriverBase::getDerivativeDefinitions

See also

getDerivativeDefinition()

File

core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntityDeriver.php, line 48

Class

ContentEntityDeriver
Deriver for content entity source plugins.

Namespace

Drupal\migrate_drupal\Plugin\migrate\source

Code

public function getDerivativeDefinitions($base_plugin_definition) {
  $this->derivatives = [];
  foreach ($this->entityTypeManager
    ->getDefinitions() as $id => $definition) {
    if ($definition instanceof ContentEntityTypeInterface) {
      $this->derivatives[$id] = $base_plugin_definition;

      // Provide entity_type so the source can be used apart from a deriver.
      $this->derivatives[$id]['entity_type'] = $id;
    }
  }
  return parent::getDerivativeDefinitions($base_plugin_definition);
}