Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. InlineBlockDeriver.php

function InlineBlockDeriver::getDerivativeDefinitions

Overrides DeriverBase::getDerivativeDefinitions

File

core/modules/layout_builder/src/Plugin/Derivative/InlineBlockDeriver.php, line 47

Class

InlineBlockDeriver
Provides inline block plugin definitions for all block types.

Namespace

Drupal\layout_builder\Plugin\Derivative

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal