You are here

protected function ExtraFieldBlockPlugin::getBlockTypeInstance in Entity Extra Field 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/ExtraFieldType/ExtraFieldBlockPlugin.php \Drupal\entity_extra_field\Plugin\ExtraFieldType\ExtraFieldBlockPlugin::getBlockTypeInstance()

Get block type instance.

Return value

bool|\Drupal\Core\Block\BlockBase The block instance; otherwise FALSE if type is not defined.

Throws

\Drupal\Component\Plugin\Exception\PluginException

4 calls to ExtraFieldBlockPlugin::getBlockTypeInstance()
ExtraFieldBlockPlugin::build in src/Plugin/ExtraFieldType/ExtraFieldBlockPlugin.php
Build the render array of the extra field type contents.
ExtraFieldBlockPlugin::calculateDependencies in src/Plugin/ExtraFieldType/ExtraFieldBlockPlugin.php
Calculates dependencies for the configured plugin.
ExtraFieldBlockPlugin::submitConfigurationForm in src/Plugin/ExtraFieldType/ExtraFieldBlockPlugin.php
Form submission handler.
ExtraFieldBlockPlugin::validateConfigurationForm in src/Plugin/ExtraFieldType/ExtraFieldBlockPlugin.php
Form validation handler.

File

src/Plugin/ExtraFieldType/ExtraFieldBlockPlugin.php, line 283

Class

ExtraFieldBlockPlugin
Define extra field block type.

Namespace

Drupal\entity_extra_field\Plugin\ExtraFieldType

Code

protected function getBlockTypeInstance() {
  $config = $this
    ->getConfiguration();
  if (!isset($config['block_type'])) {
    return FALSE;
  }
  return $this->blockManager
    ->createInstance($config['block_type'], $config['block_config']);
}