/** * CircleBreadcrumbs constructor. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, MenuLinkManagerInterface $link, MenuActiveTrailInterface $active, $link_tree) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->linkManager = $link; $this->active = $active; $this->linkTree = $link_tree; }
/** * Creates a HelpBlock instance. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Symfony\Component\HttpFoundation\Request $request * The current request. * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler * The module handler. * @param \Drupal\Core\Routing\RouteMatchInterface $route_match * The current route match. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, Request $request, ModuleHandlerInterface $module_handler, RouteMatchInterface $route_match) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->request = $request; $this->moduleHandler = $module_handler; $this->routeMatch = $route_match; }
/** * Constructs an SimplenewsSubscriptionBlock object. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Entity\EntityStorageInterface; $newsletterStorage * The storage object for newsletters. * @param \Drupal\Core\Form\FormBuilderInterface $formBuilder * The form builder object. * @param \Drupal\Core\Entity\Query\QueryInterface $newsletterQuery * The entity query object for newsletters. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager, FormBuilderInterface $formBuilder, QueryInterface $newsletterQuery) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->entityManager = $entity_manager; $this->formBuilder = $formBuilder; $this->newsletterQuery = $newsletterQuery; }
/** * Constructs a new SwitchUserBlock object. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Session\AccountInterface $current_user * Current user. * @param \Drupal\Core\Entity\EntityStorageInterface $user_storage * The user storage. * @param \Drupal\Core\Form\FormBuilderInterface $form_builder * The form builder service. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, AccountInterface $current_user, EntityStorageInterface $user_storage, FormBuilderInterface $form_builder) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->formBuilder = $form_builder; $this->currentUser = $current_user; $this->userStorage = $user_storage; }
/** * Constructs an AggregatorFeedBlock object. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\aggregator\FeedStorageInterface $feed_storage * The entity storage for feeds. * @param \Drupal\aggregator\ItemStorageInterface $item_storage * The entity storage for feed items. * @param \Drupal\Core\Entity\Query\QueryInterface $item_query * The entity query object for feed items. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, FeedStorageInterface $feed_storage, ItemStorageInterface $item_storage, QueryInterface $item_query) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->feedStorage = $feed_storage; $this->itemStorage = $item_storage; $this->itemQuery = $item_query; }
/** * Creates a NodeBlock instance. * * @param array $configuration * @param string $plugin_id * @param mixed $plugin_definition * @param EntityManagerInterface $entity_manager */ public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entity_manager) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->viewBuilder = $entity_manager->getViewBuilder('node'); $this->nodeStorage = $entity_manager->getStorage('node'); $this->node = $entity_manager->getStorage('node')->load($this->getDerivativeId()); }
/** * Construct. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * @param mixed $plugin_definition * @param \Drupal\Core\Entity\EntityManager $entity_manager * @param \Drupal\Core\Entity\Query\QueryFactory $entity_query * @param \Drupal\Core\Entity\EntityFormBuilder $entity_form_builder */ public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManager $entity_manager, QueryFactory $entity_query, EntityFormBuilder $entity_form_builder) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->entity_manager = $entity_manager; $this->entity_query = $entity_query; $this->entity_form_builder = $entity_form_builder; }
/** * {@inheritdoc} */ public function __construct(array $configuration, $plugin_id, $plugin_definition) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->platformManager = \Drupal::service('plugin.manager.social_media_links.platform'); $this->iconsetManager = \Drupal::service('plugin.manager.social_media_links.iconset'); $this->iconsetFinderService = \Drupal::service('social_media_links.finder'); }
/** * Construct. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin_id for the plugin instance. * @param string $plugin_definition * The plugin implementation definition. * * Add type-hinted parameters for any services to be injected into this class * following the normal parameters. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManager $entity_manager, QueryFactory $entity_query) { parent::__construct($configuration, $plugin_id, $plugin_definition); // Make each of injected service available as a variable in the class. $this->entity_manager = $entity_manager; $this->entity_query = $entity_query; }
/** * Constructs a AddContentBlock object. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin ID for the plugin instance. * @param string $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Plugin\Context\ContextProviderInterface $collection_context * The collection context. * @param \Drupal\Core\Plugin\Context\ContextProviderInterface $solution_context * The solution context. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, ContextProviderInterface $collection_context, ContextProviderInterface $solution_context, ContextProviderInterface $asset_release_context) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->collectionContext = $collection_context; $this->solutionContext = $solution_context; $this->assetReleaseContext = $asset_release_context; }
/** * Constructs RecentContent class. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin_id for the plugin instance. * @param string $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Entity\Query\QueryFactory * The entity query factory. * @param EntityTypeManagerInterface $entity_type_manager * The entity type manager. * @param \Drupal\Core\Render\RendererInterface * The renderer. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, QueryFactory $entity_query, EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->entityQuery = $entity_query; $this->entityTypeManager = $entity_type_manager; $this->renderer = $renderer; }
/** * Constructs a new NodeFormBlock plugin * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Entity\EntityManagerInterface $entityManger * The entity manager. * @param \Drupal\Core\Entity\EntityFormBuilderInterface $entityFormBuilder * The entity form builder. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManagerInterface $entityManager, EntityFormBuilderInterface $entityFormBuilder) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->setConfiguration($configuration); $this->entityManager = $entityManager; $this->entityFormBuilder = $entityFormBuilder; }
/** * Constructs a new BookNavigationBlock instance. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack * The request stack object. * @param \Drupal\book\BookManagerInterface $book_manager * The book manager. * @param \Drupal\Core\Entity\EntityStorageInterface $node_storage * The node storage. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, RequestStack $request_stack, BookManagerInterface $book_manager, EntityStorageInterface $node_storage) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->requestStack = $request_stack; $this->bookManager = $book_manager; $this->nodeStorage = $node_storage; }
/** * Constructs a new DevelSwitchUser object. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Access\CsrfTokenGenerator $csrf_token_generator * @param \Drupal\Core\Form\FormBuilderInterface $form_builder * @param \Drupal\Core\Session\AccountProxyInterface $current_user */ public function __construct(array $configuration, $plugin_id, $plugin_definition, CsrfTokenGenerator $csrf_token_generator, FormBuilderInterface $form_builder, AccountProxyInterface $current_user, RedirectDestinationInterface $redirect_destination) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->csrfTokenGenerator = $csrf_token_generator; $this->formBuilder = $form_builder; $this->currentUser = $current_user; $this->redirectDestination = $redirect_destination; }
/** * Constructs a new DisqusBaseBlock. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin ID for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Routing\RouteMatchInterface $route_match * The current route match. * @param \Drupal\disqus\DisqusCommentManager $disqus_manager * The disqus comment manager object. * @param \Drupal\Core\Session\AccountInterface $current_user * The account for which view access should be checked. * @param \Drupal\Core\Config\ImmutableConfig $disqus_config * Disqus config object. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, RouteMatchInterface $route_match, DisqusCommentManager $disqus_manager, AccountInterface $current_user, ImmutableConfig $disqus_config) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->currentUser = $current_user; $this->disqusManager = $disqus_manager; $this->routeMatch = $route_match; $this->disqusConfig = $disqus_config; }
/** * Constructs a CollectionContentBlock object. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin ID for the plugin instance. * @param string $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Routing\RouteMatchInterface $current_route_match * The current route match service. * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * The entity type manager. * @param \Drupal\Core\Plugin\Context\ContextProviderInterface $collection_context * The collection context. * @param \Drupal\og\MembershipManagerInterface $membership_manager * The OG membership manager. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, RouteMatchInterface $current_route_match, EntityTypeManagerInterface $entity_type_manager, ContextProviderInterface $collection_context, MembershipManagerInterface $membership_manager) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->currentRouteMatch = $current_route_match; $this->collection = $collection_context->getRuntimeContexts(['og'])['og']->getContextValue(); $this->entityTypeManager = $entity_type_manager; $this->membershipManager = $membership_manager; }
/** * Constructs a new BlockContentBlock. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin ID for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Block\BlockManagerInterface * The Plugin Block Manager. * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager * The entity manager service. * @param \Drupal\Core\Session\AccountInterface $account * The account for which view access should be checked. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, BlockManagerInterface $block_manager, EntityManagerInterface $entity_manager, AccountInterface $account, UrlGeneratorInterface $url_generator) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->blockManager = $block_manager; $this->entityManager = $entity_manager; $this->account = $account; $this->urlGenerator = $url_generator; }
/** * {@inheritdoc} */ function __construct(array $configuration, $plugin_id, $plugin_definition, RequestStack $requestStack, FlippyPager $flippyPager, ConfigFactoryInterface $configFactoryInterface, CurrentRouteMatch $routeMatch) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->request = $requestStack->getCurrentRequest(); $this->flippyPager = $flippyPager; $this->flippySettings = $configFactoryInterface->get('flippy.settings'); $this->routeMatch = $routeMatch; }
/** * Constructs a SolutionContentBlock. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin_id for the plugin instance. * @param string $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Routing\RouteMatchInterface $current_route_match * The route matcher. * @param \Drupal\Core\Entity\EntityManager $entity_manager * The deprecated entity manager. * @param \Drupal\Core\Plugin\Context\ContextProviderInterface $solution_context * The context provider for the solution context. * * @todo EntityManager is deprecated. Use EntityTypeManager instead. * * @see https://webgate.ec.europa.eu/CITnet/jira/browse/ISAICP-2669 */ public function __construct(array $configuration, $plugin_id, $plugin_definition, RouteMatchInterface $current_route_match, EntityManager $entity_manager, ContextProviderInterface $solution_context) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->currentRouteMatch = $current_route_match; if (!empty($solution_context->getRuntimeContexts(['solution'])['solution'])) { $this->solution = $solution_context->getRuntimeContexts(['solution'])['solution']->getContextValue(); } $this->entityManager = $entity_manager; }
/** * MegaMenuBlock constructor. * * {@inheritdoc} * * @param EntityTypeManagerInterface $entityTypeManager * The Drupal entity type manager. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entityTypeManager, MenuLinkTreeInterface $menuLinkTree, LayoutPluginManagerInterface $layoutPluginManager, ContextHandlerInterface $contextHandler, ContextRepositoryInterface $contextRepository, AccountInterface $account) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->entityTypeManager = $entityTypeManager; $this->menuLinkTree = $menuLinkTree; $this->layoutPluginManager = $layoutPluginManager; $this->contextHandler = $contextHandler; $this->contextRepository = $contextRepository; $this->account = $account; }
/** * Constructs a \Drupal\views\Plugin\Block\ViewsBlockBase object. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\views\ViewExecutableFactory $executable_factory * The view executable factory. * @param \Drupal\Core\Entity\EntityStorageInterface $storage * The views storage. * @param \Drupal\Core\Session\AccountInterface $user * The current user. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, ViewExecutableFactory $executable_factory, EntityStorageInterface $storage, AccountInterface $user) { $this->pluginId = $plugin_id; $delta = $this->getDerivativeId(); list($name, $this->displayID) = explode('-', $delta, 2); // Load the view. $view = $storage->load($name); $this->view = $executable_factory->get($view); $this->displaySet = $this->view->setDisplay($this->displayID); $this->user = $user; parent::__construct($configuration, $plugin_id, $plugin_definition); }
/** * Constructs a new EntityField. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin ID for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager * The entity type manager. * @param \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager * The entity field manager. * @param \Drupal\Core\Field\FormatterPluginManager $formatter_manager * The formatter manager. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager, FieldTypePluginManagerInterface $field_type_manager, FormatterPluginManager $formatter_manager) { $this->entityTypeManager = $entity_type_manager; $this->entityFieldManager = $entity_field_manager; $this->fieldTypeManager = $field_type_manager; $this->formatterManager = $formatter_manager; // Get the entity type and field name from the plugin id. list(, $entity_type_id, $field_name) = explode(':', $plugin_id); $this->entityTypeId = $entity_type_id; $this->fieldName = $field_name; parent::__construct($configuration, $plugin_id, $plugin_definition); }
/** * Constructs a new RedirectFormBlock. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Form\FormBuilderInterface $form_builder * The form builder. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, FormBuilderInterface $form_builder) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->formBuilder = $form_builder; }
/** * Construct. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * @param mixed $plugin_definition * @param \Drupal\Core\Entity\EntityManager $entity_manager */ public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityManager $entity_manager) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->entity_manager = $entity_manager; $this->view_modes = $this->entity_manager->getViewModeOptions('node'); }
/** * Constructs a new UserLoginBlock instance. * * @param array $configuration * The plugin configuration, i.e. an array with configuration values keyed * by configuration option name. The special key 'context' may be used to * initialize the defined contexts by setting it to an array of context * values keyed by context names. * @param string $plugin_id * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Routing\RouteMatchInterface $route_match * The route match. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, RouteMatchInterface $route_match) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->routeMatch = $route_match; }
/** * Constructs an LanguageBlock object. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager * The language manager. * @param \Drupal\Core\Path\PathMatcherInterface $path_matcher * The path matcher. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, LanguageManagerInterface $language_manager, PathMatcherInterface $path_matcher) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->languageManager = $language_manager; $this->pathMatcher = $path_matcher; }
/** * Tests the test access block. * * * @param array $configuration * The plugin configuration, i.e. an array with configuration values keyed * by configuration option name. The special key 'context' may be used to * initialize the defined contexts by setting it to an array of context * values keyed by context names. * @param string $plugin_id * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\State\StateInterface $state * The state. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, StateInterface $state) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->state = $state; }
/** * Creates a SystemBrandingBlock instance. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The factory for configuration objects. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigFactoryInterface $config_factory) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->configFactory = $config_factory; }
/** * Construct a FacetBlock instance. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin_id for the plugin instance. * @param string $plugin_definition * The plugin implementation definition. * @param \Drupal\facets\FacetManager\DefaultFacetManager $facet_manager * The facet manager. * @param \Drupal\Core\Entity\EntityStorageInterface $facet_storage * The entity storage used for facets. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, DefaultFacetManager $facet_manager, EntityStorageInterface $facet_storage) { $this->facetManager = $facet_manager; $this->facetStorage = $facet_storage; parent::__construct($configuration, $plugin_id, $plugin_definition); }
/** * Constructs an SharethisBlock object. * * @param array $configuration * A configuration array containing information about the plugin instance. * @param string $plugin_id * The plugin_id for the plugin instance. * @param mixed $plugin_definition * The plugin implementation definition. * @param \Drupal\Core\Config\Config $sharethis_settings * The config object for 'sharethis.settings'. * @param \Drupal\sharethis\SharethisManagerInterface $sharethis_manager * The module manager service. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, Config $sharethis_settings, SharethisManagerInterface $sharethis_manager) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->sharethisSettings = $sharethis_settings; $this->sharethisManager = $sharethis_manager; }