class MicrositeMenuItemDeriver in Entity Reference Hierarchy 3.x
Same name and namespace in other branches
- 8.2 modules/entity_hierarchy_microsite/src/Plugin/Deriver/MicrositeMenuItemDeriver.php \Drupal\entity_hierarchy_microsite\Plugin\Deriver\MicrositeMenuItemDeriver
Defines a class for deriving menu links from a tree.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\entity_hierarchy_microsite\Plugin\Deriver\MicrositeMenuItemDeriver implements ContainerDeriverInterface
Expanded class hierarchy of MicrositeMenuItemDeriver
1 string reference to 'MicrositeMenuItemDeriver'
- entity_hierarchy_microsite.links.menu.yml in modules/
entity_hierarchy_microsite/ entity_hierarchy_microsite.links.menu.yml - modules/entity_hierarchy_microsite/entity_hierarchy_microsite.links.menu.yml
File
- modules/
entity_hierarchy_microsite/ src/ Plugin/ Deriver/ MicrositeMenuItemDeriver.php, line 13
Namespace
Drupal\entity_hierarchy_microsite\Plugin\DeriverView source
class MicrositeMenuItemDeriver extends DeriverBase implements ContainerDeriverInterface {
/**
* Link discovery.
*
* @var \Drupal\entity_hierarchy_microsite\MicrositeMenuLinkDiscoveryInterface
*/
private $micrositeMenuLinkDiscovery;
/**
* Constructs a new MicrositeMenuItemDeriver.
*
* @param \Drupal\entity_hierarchy_microsite\MicrositeMenuLinkDiscoveryInterface $micrositeMenuLinkDiscovery
* Link discovery.
*/
public function __construct(MicrositeMenuLinkDiscoveryInterface $micrositeMenuLinkDiscovery) {
$this->micrositeMenuLinkDiscovery = $micrositeMenuLinkDiscovery;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, $base_plugin_id) {
return new static($container
->get('entity_hierarchy_microsite.menu_link_discovery'));
}
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
$this->derivatives = $this->micrositeMenuLinkDiscovery
->getMenuLinkDefinitions();
return parent::getDerivativeDefinitions($base_plugin_definition);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
MicrositeMenuItemDeriver:: |
private | property | Link discovery. | |
MicrositeMenuItemDeriver:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
MicrositeMenuItemDeriver:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |
|
MicrositeMenuItemDeriver:: |
public | function | Constructs a new MicrositeMenuItemDeriver. |