You are here

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

Expanded class hierarchy of DynamicMenuLinks

File

modules/campaignmonitor_user/src/Plugin/Deriver/DynamicMenuLinks.php, line 18

Namespace

Drupal\campaignmonitor_user\Plugin\Deriver
View 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

Namesort descending Modifiers Type Description Overrides
ContainerDeriverInterface::create public static function Creates a new class instance. 38
DeriverBase::$derivatives protected property List of derivative definitions. 1
DeriverBase::getDerivativeDefinition public function Gets the definition of a derivative plugin. Overrides DeriverInterface::getDerivativeDefinition
DynamicMenuLinks::getDerivativeDefinitions public function Gets the definition of all derivatives of a base plugin. Overrides DeriverBase::getDerivativeDefinitions