entityTypeManager = $entityTypeManager; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container, $base_plugin_id) { return new static( $base_plugin_id, $container->get('entity_type.manager') ); } /** * {@inheritdoc} */ 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); } }