entityTypeManager = $entity_type_manager; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container, $base_plugin_id) { return new static( $container->get('entity_type.manager') ); } /** * {@inheritdoc} */ public function getDerivativeDefinitions($base_plugin_definition) { $this->derivatives = []; if ($this->entityTypeManager->hasDefinition('block_content_type')) { $block_content_types = $this->entityTypeManager->getStorage('block_content_type')->loadMultiple(); foreach ($block_content_types as $id => $type) { $this->derivatives[$id] = $base_plugin_definition; $this->derivatives[$id]['admin_label'] = $type->label(); $this->derivatives[$id]['config_dependencies'][$type->getConfigDependencyKey()][] = $type->getConfigDependencyName(); } } return parent::getDerivativeDefinitions($base_plugin_definition); } }