Esempio n. 1
0
 /**
  * Constructs a new BlockPageVariant.
  *
  * @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\block\BlockRepositoryInterface $block_repository
  *   The block repository.
  * @param \Drupal\Core\Entity\EntityViewBuilderInterface $block_view_builder
  *   The block view builder.
  * @param string[] $block_list_cache_tags
  *   The Block entity type list cache tags.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, BlockRepositoryInterface $block_repository, EntityViewBuilderInterface $block_view_builder, array $block_list_cache_tags)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->blockRepository = $block_repository;
     $this->blockViewBuilder = $block_view_builder;
     $this->blockListCacheTags = $block_list_cache_tags;
 }
 /**
  * Constructs a new FullPageVariant.
  *
  * @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 $block_storage
  *   The block entity storage.
  * @param \Drupal\Core\Entity\EntityViewBuilderInterface $block_view_builder
  *   The block view builder.
  * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
  *   The current route match.
  * @param \Drupal\Core\Theme\ThemeNegotiatorInterface $theme_negotiator
  *   The theme negotiator.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityStorageInterface $block_storage, EntityViewBuilderInterface $block_view_builder, RouteMatchInterface $route_match, ThemeNegotiatorInterface $theme_negotiator)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->blockStorage = $block_storage;
     $this->blockViewBuilder = $block_view_builder;
     $this->routeMatch = $route_match;
     $this->themeNegotiator = $theme_negotiator;
 }
 /**
  * Constructs a new BlockDisplayVariant.
  *
  * @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\Plugin\Context\ContextHandlerInterface $context_handler
  *   The context handler.
  * @param \Drupal\Core\Session\AccountInterface $account
  *   The current user.
  * @param \Drupal\Component\Uuid\UuidInterface $uuid_generator
  *   The UUID generator.
  * @param \Drupal\Core\Utility\Token $token
  *   The token service.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, ContextHandlerInterface $context_handler, AccountInterface $account, UuidInterface $uuid_generator, Token $token)
 {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->contextHandler = $context_handler;
     $this->account = $account;
     $this->uuidGenerator = $uuid_generator;
     $this->token = $token;
 }
 /**
  * Constructs a new BlockDisplayVariant.
  *
  * @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\Plugin\Context\ContextHandlerInterface $context_handler
  *   The context handler.
  * @param \Drupal\Core\Session\AccountInterface $account
  *   The current user.
  * @param \Drupal\Component\Uuid\UuidInterface $uuid_generator
  *   The UUID generator.
  * @param \Drupal\Core\Utility\Token $token
  *   The token service.
  * @param \Drupal\Core\Block\BlockManager $block_manager
  *   The block manager.
  * @param \Drupal\Core\Condition\ConditionManager $condition_manager
  *   The condition manager.
  */
 public function __construct(array $configuration, $plugin_id, $plugin_definition, ContextHandlerInterface $context_handler, AccountInterface $account, UuidInterface $uuid_generator, Token $token, BlockManager $block_manager, ConditionManager $condition_manager)
 {
     // Inject dependencies as early as possible, so they can be used in
     // configuration.
     $this->contextHandler = $context_handler;
     $this->account = $account;
     $this->uuidGenerator = $uuid_generator;
     $this->token = $token;
     $this->blockManager = $block_manager;
     $this->conditionManager = $condition_manager;
     parent::__construct($configuration, $plugin_id, $plugin_definition);
 }