class BlocktabsBlock in Block Tabs 8
Same name in this branch
- 8 src/Plugin/Derivative/BlocktabsBlock.php \Drupal\blocktabs\Plugin\Derivative\BlocktabsBlock
- 8 src/Plugin/Block/BlocktabsBlock.php \Drupal\blocktabs\Plugin\Block\BlocktabsBlock
Provides block plugin definitions for blocktabs.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\blocktabs\Plugin\Derivative\BlocktabsBlock implements ContainerDeriverInterface
Expanded class hierarchy of BlocktabsBlock
See also
\Drupal\blocktabs\Plugin\Block\BlocktabsBlock
File
- src/
Plugin/ Derivative/ BlocktabsBlock.php, line 15
Namespace
Drupal\blocktabs\Plugin\DerivativeView source
class BlocktabsBlock extends DeriverBase implements ContainerDeriverInterface {
/**
* The entity storage.
*
* @var \Drupal\Core\Entity\EntityStorageInterface
*/
protected $entityStorage;
/**
* Constructs new SystemMenuBlock.
*
* @param \Drupal\Core\Entity\EntityStorageInterface $entity_storage
* The entity storage.
*/
public function __construct(EntityStorageInterface $entity_storage) {
$this->entityStorage = $entity_storage;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, $base_plugin_id) {
return new static($container
->get('entity_type.manager')
->getStorage('blocktabs'));
}
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
foreach ($this->entityStorage
->loadMultiple() as $blocktabs => $entity) {
$this->derivatives[$blocktabs] = $base_plugin_definition;
$this->derivatives[$blocktabs]['admin_label'] = 'Blocktabs:' . $entity
->label();
$this->derivatives[$blocktabs]['config_dependencies']['config'] = [
$entity
->getConfigDependencyName(),
];
}
return $this->derivatives;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BlocktabsBlock:: |
protected | property | The entity storage. | |
BlocktabsBlock:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
BlocktabsBlock:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |
|
BlocktabsBlock:: |
public | function | Constructs new SystemMenuBlock. | |
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |