class DynamicMenuLinks in Campaign Monitor 8
Provides a deriver for user entered paths of menu links.
The assumption is that the number of manually entered menu links are lower compared to entity referenced ones.
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\campaignmonitor_user\Plugin\Deriver\DynamicMenuLinks implements ContainerDeriverInterface
Expanded class hierarchy of DynamicMenuLinks
File
- modules/
campaignmonitor_user/ src/ Plugin/ Deriver/ DynamicMenuLinks.php, line 18
Namespace
Drupal\campaignmonitor_user\Plugin\DeriverView source
class DynamicMenuLinks extends DeriverBase implements ContainerDeriverInterface {
/**
* Constructs a MenuLinkContentDeriver instance.
*
* @param \Drupal\Core\Entity\Query\QueryFactory $query_factory
* The query factory.
* @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
* The entity manager.
* @param \Drupal\Core\Menu\MenuLinkManagerInterface $menu_link_manager
* The menu link manager.
*/
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
$config = \Drupal::config('campaignmonitor_user.settings');
$links = array(
'route_name' => 'campaignmonitor.user.subscriptions',
'id' => 'campaignmonitor_user.subscriptions',
);
$links['title'] = $config
->get('subscription_heading');
$links['description'] = 'Subscribe to Campaign Monitor';
$links['parent'] = 'main:';
$links['enabled'] = 1;
return $links;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContainerDeriverInterface:: |
public static | function | Creates a new class instance. | 38 |
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
DynamicMenuLinks:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides DeriverBase:: |