class SelectionPluginBase
Same name in other branches
- 9 core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginBase.php \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginBase
- 8.9.x core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginBase.php \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginBase
- 11.x core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginBase.php \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginBase
Provides a base class for configurable selection handlers.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
- class \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface, \Drupal\Component\Plugin\ConfigurableInterface, \Drupal\Component\Plugin\DependentPluginInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
Expanded class hierarchy of SelectionPluginBase
3 files declare their use of SelectionPluginBase
- Broken.php in core/
lib/ Drupal/ Core/ Entity/ Plugin/ EntityReferenceSelection/ Broken.php - DefaultSelection.php in core/
lib/ Drupal/ Core/ Entity/ Plugin/ EntityReferenceSelection/ DefaultSelection.php - ViewsSelection.php in core/
modules/ views/ src/ Plugin/ EntityReferenceSelection/ ViewsSelection.php
File
-
core/
lib/ Drupal/ Core/ Entity/ EntityReferenceSelection/ SelectionPluginBase.php, line 15
Namespace
Drupal\Core\Entity\EntityReferenceSelectionView source
abstract class SelectionPluginBase extends PluginBase implements SelectionInterface, ConfigurableInterface, DependentPluginInterface {
/**
* 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 defaultConfiguration() {
return [
'target_type' => NULL,
'entity' => NULL,
];
}
/**
* {@inheritdoc}
*/
public function getConfiguration() {
return $this->configuration;
}
/**
* {@inheritdoc}
*/
public function setConfiguration(array $configuration) {
// Merge in defaults.
$this->configuration = NestedArray::mergeDeep($this->defaultConfiguration(), $configuration);
}
/**
* {@inheritdoc}
*/
public function calculateDependencies() {
return [];
}
/**
* {@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 entityQueryAlter(SelectInterface $query) {
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.