class ViewsLocalTask extends DeriverBase implements ContainerDeriverInterface (View source)

Provides local task definitions for all views configured as local tasks.

Properties

protected array $derivatives

List of derivative definitions.

from  DeriverBase
protected RouteProviderInterface $routeProvider

The route provider.

protected StateInterface $state

The state key value store.

protected EntityStorageInterface $viewStorage

The view storage.

Methods

array
getDerivativeDefinition(string $derivative_id, array|PluginDefinitionInterface $base_plugin_definition)

Gets the definition of a derivative plugin.

array
getDerivativeDefinitions(array $base_plugin_definition)

Gets the definition of all derivatives of a base plugin.

__construct(RouteProviderInterface $route_provider, StateInterface $state, EntityStorageInterface $view_storage)

Constructs a \Drupal\views\Plugin\Derivative\ViewsLocalTask instance.

create(ContainerInterface $container, string $base_plugin_id)

Creates a new class instance.

alterLocalTasks($local_tasks)

Alters base_route and parent_id into the views local tasks.

array
getApplicableMenuViews()

Return a list of all views and display IDs that have a menu entry.

Details

array getDerivativeDefinition(string $derivative_id, array|PluginDefinitionInterface $base_plugin_definition)

Gets the definition of a derivative plugin.

Parameters

string $derivative_id

The derivative id. The id must uniquely identify the derivative within a given base plugin, but derivative ids can be reused across base plugins.

array|PluginDefinitionInterface $base_plugin_definition

The definition of the base plugin from which the derivative plugin is derived. It is maybe an entire object or just some array, depending on the discovery mechanism.

Return Value

array

The full definition array of the derivative plugin, typically a merge of $base_plugin_definition with extra derivative-specific information. NULL if the derivative doesn't exist.

array getDerivativeDefinitions(array $base_plugin_definition)

Gets the definition of all derivatives of a base plugin.

Parameters

array $base_plugin_definition

The definition array of the base plugin.

Return Value

array

An array of full derivative definitions keyed on derivative id.

__construct(RouteProviderInterface $route_provider, StateInterface $state, EntityStorageInterface $view_storage)

Constructs a \Drupal\views\Plugin\Derivative\ViewsLocalTask instance.

Parameters

RouteProviderInterface $route_provider

The route provider.

StateInterface $state

The state key value store.

EntityStorageInterface $view_storage

The view storage.

static ContainerDeriverInterface create(ContainerInterface $container, string $base_plugin_id)

Creates a new class instance.

Parameters

ContainerInterface $container

The container to pull out services used in the fetcher.

string $base_plugin_id

The base plugin ID for the plugin ID.

Return Value

ContainerDeriverInterface

Returns an instance of this fetcher.

alterLocalTasks($local_tasks)

Alters base_route and parent_id into the views local tasks.

Parameters

$local_tasks

protected array getApplicableMenuViews()

Return a list of all views and display IDs that have a menu entry.

Return Value

array

A list of arrays containing the $view and $display_id.