class ContentEntityDeriver
Same name in this branch
- 11.x core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntityDeriver.php \Drupal\migrate_drupal\Plugin\migrate\source\ContentEntityDeriver
Same name in other branches
- 9 core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntityDeriver.php \Drupal\migrate_drupal\Plugin\migrate\source\ContentEntityDeriver
- 8.9.x core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntityDeriver.php \Drupal\migrate_drupal\Plugin\migrate\source\ContentEntityDeriver
- 10 core/modules/migrate_drupal/src/Plugin/migrate/source/ContentEntityDeriver.php \Drupal\migrate_drupal\Plugin\migrate\source\ContentEntityDeriver
Deriver for content entity source plugins.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements \Drupal\Component\Plugin\Derivative\DeriverInterface
- class \Drupal\migrate\Plugin\migrate\source\ContentEntityDeriver extends \Drupal\Component\Plugin\Derivative\DeriverBase implements \Drupal\Core\Plugin\Discovery\ContainerDeriverInterface
Expanded class hierarchy of ContentEntityDeriver
File
-
core/
modules/ migrate/ src/ Plugin/ migrate/ source/ ContentEntityDeriver.php, line 14
Namespace
Drupal\migrate\Plugin\migrate\sourceView source
class ContentEntityDeriver extends DeriverBase implements ContainerDeriverInterface {
/**
* Constructs a new ContentEntityDeriver.
*
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager
* The entity type manager.
*/
public function __construct(EntityTypeManagerInterface $entityTypeManager) {
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, $base_plugin_id) : static {
return new static($container->get('entity_type.manager'));
}
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) : ?array {
$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);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
ContentEntityDeriver::create | public static | function | Creates a new class instance. | Overrides ContainerDeriverInterface::create | |
ContentEntityDeriver::getDerivativeDefinitions | public | function | Gets the definition of all derivatives of a base plugin. | Overrides DeriverBase::getDerivativeDefinitions | |
ContentEntityDeriver::__construct | public | function | Constructs a new ContentEntityDeriver. | ||
DeriverBase::$derivatives | protected | property | List of derivative definitions. | 1 | |
DeriverBase::getDerivativeDefinition | public | function | Gets the definition of a derivative plugin. | Overrides DeriverInterface::getDerivativeDefinition |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.