class ConfigActionsInclude in Config Actions 8
Plugin for including an action from another module.
Plugin annotation
@ConfigActionsPlugin(
id = "include",
description = @Translation("Include action."),
options = {
"module" = "",
"file" = "",
"action" = "",
"template" = "",
}
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\config_actions\ConfigActionsPluginBase implements ConfigActionsPluginInterface, ContainerFactoryPluginInterface
- class \Drupal\config_actions\Plugin\ConfigActions\ConfigActionsInclude
- class \Drupal\config_actions\ConfigActionsPluginBase implements ConfigActionsPluginInterface, ContainerFactoryPluginInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of ConfigActionsInclude
File
- src/
Plugin/ ConfigActions/ ConfigActionsInclude.php, line 22
Namespace
Drupal\config_actions\Plugin\ConfigActionsView source
class ConfigActionsInclude extends ConfigActionsPluginBase {
/**
* Name of module containing action.
* @var string
*/
protected $module;
/**
* Optional Name of file to include.
* @var string
*/
protected $file;
/**
* Optional Name of action to include.
* @var string
*/
protected $action;
/**
* The template file to be loaded from the master config/templates list.
* @var
*/
protected $template;
/**
* Remove plugin-specific options to just leave those to override import.
* @param $action
*/
protected function cleanAction($action) {
unset($action['plugin']);
unset($action['module']);
unset($action['file']);
unset($action['action']);
// Ensure included actions get executed.
$action['auto'] = TRUE;
return $action;
}
/**
* Main execute to perform the include
*/
public function execute(array $action) {
if (isset($this->replace)) {
$action['replace'] = NestedArray::mergeDeepArray([
$this->replace,
isset($action['replace']) ? $action['replace'] : [],
], TRUE);
}
$action = $this
->cleanAction($action);
return $this->actionService
->importAction($this->module, $this->action, $this->file, $action);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigActionsInclude:: |
protected | property | Optional Name of action to include. | |
ConfigActionsInclude:: |
protected | property | Optional Name of file to include. | |
ConfigActionsInclude:: |
protected | property |
Name of module containing action. Overrides ConfigActionsPluginBase:: |
|
ConfigActionsInclude:: |
protected | property |
The template file to be loaded from the master config/templates list.
@var Overrides ConfigActionsPluginBase:: |
|
ConfigActionsInclude:: |
protected | function | Remove plugin-specific options to just leave those to override import. | |
ConfigActionsInclude:: |
public | function |
Main execute to perform the include Overrides ConfigActionsPluginBase:: |
|
ConfigActionsPluginBase:: |
protected | property | ||
ConfigActionsPluginBase:: |
protected | property | The list of allowed option keys. Taken from the plugin annotation. key/value array where the key is the option name and the value is the default. | |
ConfigActionsPluginBase:: |
protected | property | If FALSE, do not run action when service has autoExecute enabled. | |
ConfigActionsPluginBase:: |
protected | property | Optional Base path for source and dest. | |
ConfigActionsPluginBase:: |
protected | property | Optional config corresponding to id. | |
ConfigActionsPluginBase:: |
protected | property | Optional destination id of config item. | |
ConfigActionsPluginBase:: |
protected | property | Plugin type of the destination. | |
ConfigActionsPluginBase:: |
protected | property | List to keep track of what options have had string replacement. | |
ConfigActionsPluginBase:: |
protected | property | The id of the action. | |
ConfigActionsPluginBase:: |
protected | property | The pattern of the action key (id). | |
ConfigActionsPluginBase:: |
protected | property | Optional data used by the plugins. Taken from the plugin annotation. | |
ConfigActionsPluginBase:: |
protected | property |
The id name of the plugin instance. Overrides PluginBase:: |
|
ConfigActionsPluginBase:: |
protected | property | List of string replacement variables and values. | |
ConfigActionsPluginBase:: |
protected | property | List of options that allow string replacement. | |
ConfigActionsPluginBase:: |
protected | property | Source data to manipulate. | |
ConfigActionsPluginBase:: |
protected | property | Plugin type of the source. | |
ConfigActionsPluginBase:: |
protected | function | Add additional allowed options. Used by Traits in plugins to add global options. | |
ConfigActionsPluginBase:: |
public static | function |
Create a plugin instance from the container Overrides ContainerFactoryPluginInterface:: |
|
ConfigActionsPluginBase:: |
protected | function | Return a specific property from the plugin specific data. | |
ConfigActionsPluginBase:: |
public | function | Return a current option value. | |
ConfigActionsPluginBase:: |
protected | function | Initialize a plugin. | |
ConfigActionsPluginBase:: |
protected | function | Return True if array is Sequential | |
ConfigActionsPluginBase:: |
public | function | Parse any property references in the options. | |
ConfigActionsPluginBase:: |
protected | function | Perform string replacement on the $data and return the result. | |
ConfigActionsPluginBase:: |
public | function | Process an Options array to set various internal variable defaults. | |
ConfigActionsPluginBase:: |
public | function |
Return a transformed version of the source config tree. Overrides ConfigActionsPluginInterface:: |
4 |
ConfigActionsPluginBase:: |
public | function |
Constructs a new ConfigActionsPlugin object. Overrides PluginBase:: |
|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
MessengerTrait:: |
protected | property | The messenger. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
MessengerTrait:: |
public | function | Sets the messenger. | |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |