abstract class BlockFieldSelectionBase in Block field 8
Base class for Block field selection plugins.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\block_field\BlockFieldSelectionBase implements BlockFieldSelectionInterface, ConfigurableInterface
Expanded class hierarchy of BlockFieldSelectionBase
2 files declare their use of BlockFieldSelectionBase
- Blocks.php in src/
Plugin/ block_field/ BlockFieldSelection/ Blocks.php - Categories.php in src/
Plugin/ block_field/ BlockFieldSelection/ Categories.php
File
- src/
BlockFieldSelectionBase.php, line 13
Namespace
Drupal\block_fieldView source
abstract class BlockFieldSelectionBase extends PluginBase implements BlockFieldSelectionInterface, ConfigurableInterface {
/**
* Constructs a new selection 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.
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this
->setConfiguration($configuration);
}
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
return $form;
}
/**
* {@inheritdoc}
*/
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
return [];
}
/**
* {@inheritdoc}
*/
public function getConfiguration() {
return $this->configuration;
}
/**
* {@inheritdoc}
*/
public function setConfiguration(array $configuration) {
// Merge in defaults.
$this->configuration = NestedArray::mergeDeep($this
->defaultConfiguration(), $configuration);
}
/**
* Move settings up a level for easier processing and storage.
*/
public function formProcessMergeParent($element) {
$parents = $element['#parents'];
array_pop($parents);
$element['#parents'] = $parents;
return $element;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BlockFieldSelectionBase:: |
public | function |
Form constructor. Overrides PluginFormInterface:: |
2 |
BlockFieldSelectionBase:: |
public | function |
Gets default configuration for this plugin. Overrides ConfigurableInterface:: |
2 |
BlockFieldSelectionBase:: |
public | function | Move settings up a level for easier processing and storage. | |
BlockFieldSelectionBase:: |
public | function |
Gets this plugin's configuration. Overrides ConfigurableInterface:: |
|
BlockFieldSelectionBase:: |
public | function |
Sets the configuration for this plugin instance. Overrides ConfigurableInterface:: |
|
BlockFieldSelectionBase:: |
public | function |
Form submission handler. Overrides PluginFormInterface:: |
|
BlockFieldSelectionBase:: |
public | function |
Form validation handler. Overrides PluginFormInterface:: |
|
BlockFieldSelectionBase:: |
public | function |
Constructs a new selection object. Overrides PluginBase:: |
|
BlockFieldSelectionInterface:: |
public | function | Returns filtered block definitions based on plugin settings. | 2 |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
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. |