interface PluginSelectorInterface in Plugin 8.2
Defines a plugin to select and configure another plugin.
Hierarchy
- interface \Drupal\Component\Plugin\PluginInspectionInterface; interface \Drupal\Component\Plugin\ConfigurableInterface
- interface \Drupal\plugin\Plugin\Plugin\PluginSelector\PluginSelectorInterface
Expanded class hierarchy of PluginSelectorInterface
All classes that implement PluginSelectorInterface
File
- src/
Plugin/ Plugin/ PluginSelector/ PluginSelectorInterface.php, line 15
Namespace
Drupal\plugin\Plugin\Plugin\PluginSelectorView source
interface PluginSelectorInterface extends PluginInspectionInterface, ConfigurableInterface {
/**
* Sets the human-readable label.
*
* @param string $label
*
* @return $this
*/
public function setLabel($label);
/**
* Gets the human-readable label.
*
* @return string
*/
public function getLabel();
/**
* Sets the human-readable description.
*
* @param string $description
*
* @return $this
*/
public function setDescription($description);
/**
* Gets the human-readable description.
*
* @return string
*/
public function getDescription();
/**
* Sets whether a plugin must be selected.
*
* @param bool $required
*
* @return $this
*/
public function setRequired($required = TRUE);
/**
* Returns whether a plugin must be selected.
*
* @return bool
*/
public function isRequired();
/**
* Sets whether a plugin's configuration must be collected.
*
* @param bool $collect
*
* @return $this
*/
public function setCollectPluginConfiguration($collect = TRUE);
/**
* Gets whether a plugin's configuration must be collected.
*
* @return bool
*/
public function getCollectPluginConfiguration();
/**
* Sets whether previously selected plugins must be kept.
*
* @param bool $keep
*
* @return $this
*
* @see self::getPreviouslySelectedPlugins()
*/
public function setKeepPreviouslySelectedPlugins($keep = TRUE);
/**
* Gets whether previously selected plugins must be kept.
*
* @return bool
*/
public function getKeepPreviouslySelectedPlugins();
/**
* Sets previously selected plugins.
*
* @param \Drupal\Component\Plugin\PluginInspectionInterface[] $plugins
*
* @return $this
*
* @see self::setKeepPreviouslySelectedPlugins()
* @see self::setCollectPluginConfiguration()
*/
public function setPreviouslySelectedPlugins(array $plugins);
/**
* Gets previously selected plugins.
*
* @return \Drupal\Component\Plugin\PluginInspectionInterface[]
*
* @see self::setKeepPreviouslySelectedPlugins
*/
public function getPreviouslySelectedPlugins();
/**
* Gets the selected plugin.
*
* @return \Drupal\Component\Plugin\PluginInspectionInterface
*/
public function getSelectedPlugin();
/**
* Sets the selected plugin.
*
* @param \Drupal\Component\Plugin\PluginInspectionInterface $plugin
*
* @return $this
*/
public function setSelectedPlugin(PluginInspectionInterface $plugin);
/**
* Resets the selected plugin.
*
* This resets any default or explicitly set selected plugin.
*
* @return $this
*/
public function resetSelectedPlugin();
/**
* Sets the selectable plugin type.
*
* @param \Drupal\plugin\PluginType\PluginTypeInterface $plugin_type
* The type of which to select plugins.
*
* @return $this
*/
public function setSelectablePluginType(PluginTypeInterface $plugin_type);
/**
* Overrides the plugin type's discovery.
*
* @param \Drupal\Component\Plugin\Discovery\DiscoveryInterface
*
* @return $this
*
* @throws \RuntimeException
* Thrown if the plugin type was not set using
* self::setSelectablePluginType().
*/
public function setSelectablePluginDiscovery(DiscoveryInterface $plugin_discovery);
/**
* Overrides the plugin type's factory.
*
* @param \Drupal\Component\Plugin\Factory\FactoryInterface $plugin_factory
*
* @return $this
*
* @throws \RuntimeException
* Thrown if the plugin type was not set using
* self::setSelectablePluginType().
*/
public function setSelectablePluginFactory(FactoryInterface $plugin_factory);
/**
* Builds the selector form.
*
* @param mixed[] $form
* Any suggested form elements to build upon. May be ignored.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The form state for $form and the return value. This often is not the
* complete (global) form state.
*
* @return mixed[]
* The form structure.
*
* @throws \RuntimeException
* Thrown if the plugin type was not set using
* self::setSelectablePluginType().
*/
public function buildSelectorForm(array $form, FormStateInterface $form_state);
/**
* Validates the selector form.
*
* @param mixed[] $form
* The selector form as built by static::buildSelectorForm().
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The form state for $form. This often is not the complete (global) form
* state.
*/
public function validateSelectorForm(array &$form, FormStateInterface $form_state);
/**
* Submits the selector form.
*
* @param mixed[] $form
* The selector form as built by static::buildSelectorForm().
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The form state for $form. This often is not the complete (global) form
* state.
*/
public function submitSelectorForm(array &$form, FormStateInterface $form_state);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigurableInterface:: |
public | function | Gets default configuration for this plugin. | 11 |
ConfigurableInterface:: |
public | function | Gets this plugin's configuration. | 12 |
ConfigurableInterface:: |
public | function | Sets the configuration for this plugin instance. | 12 |
PluginInspectionInterface:: |
public | function | Gets the definition of the plugin implementation. | 4 |
PluginInspectionInterface:: |
public | function | Gets the plugin_id of the plugin instance. | 2 |
PluginSelectorInterface:: |
public | function | Builds the selector form. | 1 |
PluginSelectorInterface:: |
public | function | Gets whether a plugin's configuration must be collected. | 1 |
PluginSelectorInterface:: |
public | function | Gets the human-readable description. | 1 |
PluginSelectorInterface:: |
public | function | Gets whether previously selected plugins must be kept. | 1 |
PluginSelectorInterface:: |
public | function | Gets the human-readable label. | 1 |
PluginSelectorInterface:: |
public | function | Gets previously selected plugins. | 1 |
PluginSelectorInterface:: |
public | function | Gets the selected plugin. | 1 |
PluginSelectorInterface:: |
public | function | Returns whether a plugin must be selected. | 1 |
PluginSelectorInterface:: |
public | function | Resets the selected plugin. | 1 |
PluginSelectorInterface:: |
public | function | Sets whether a plugin's configuration must be collected. | 1 |
PluginSelectorInterface:: |
public | function | Sets the human-readable description. | 1 |
PluginSelectorInterface:: |
public | function | Sets whether previously selected plugins must be kept. | 1 |
PluginSelectorInterface:: |
public | function | Sets the human-readable label. | 1 |
PluginSelectorInterface:: |
public | function | Sets previously selected plugins. | 1 |
PluginSelectorInterface:: |
public | function | Sets whether a plugin must be selected. | 1 |
PluginSelectorInterface:: |
public | function | Overrides the plugin type's discovery. | 1 |
PluginSelectorInterface:: |
public | function | Overrides the plugin type's factory. | 1 |
PluginSelectorInterface:: |
public | function | Sets the selectable plugin type. | 1 |
PluginSelectorInterface:: |
public | function | Sets the selected plugin. | 1 |
PluginSelectorInterface:: |
public | function | Submits the selector form. | 1 |
PluginSelectorInterface:: |
public | function | Validates the selector form. | 1 |