interface WidgetInterface in Entity Browser 8
Same name and namespace in other branches
- 8.2 src/WidgetInterface.php \Drupal\entity_browser\WidgetInterface
Defines the interface for entity browser widgets.
Entity browser widgets present a form for actually selecting entities in an entity browser. Once entities have been selected, they are delivered upstream to the entity browser's selection display plugin.
Hierarchy
- interface \Drupal\Component\Plugin\PluginInspectionInterface; interface \Drupal\Component\Plugin\ConfigurableInterface; interface \Drupal\Core\Plugin\PluginFormInterface; interface \Drupal\Component\Plugin\DependentPluginInterface
- interface \Drupal\entity_browser\WidgetInterface
Expanded class hierarchy of WidgetInterface
All classes that implement WidgetInterface
2 files declare their use of WidgetInterface
- EntityBrowser.php in src/
Entity/ EntityBrowser.php - EntityBrowserTest.php in tests/
src/ Kernel/ Extension/ EntityBrowserTest.php
File
- src/
WidgetInterface.php, line 18
Namespace
Drupal\entity_browserView source
interface WidgetInterface extends PluginInspectionInterface, ConfigurableInterface, PluginFormInterface, DependentPluginInterface {
/**
* Returns the widget id.
*
* @return string
* The widget id.
*/
public function id();
/**
* Returns the widget UUID.
*
* @return string
* The widget UUID.
*/
public function uuid();
/**
* Returns the widget label.
*
* @return string
* The widget label.
*/
public function label();
/**
* Sets the widget's label.
*
* @param string $label
* New plugin label.
*
* @return \Drupal\entity_browser\WidgetInterface
* This object.
*/
public function setLabel($label);
/**
* Returns the widget's weight.
*
* @return int
* Widget's weight.
*/
public function getWeight();
/**
* Sets the widget's weight.
*
* @param int $weight
* New plugin weight.
*
* @return \Drupal\entity_browser\WidgetInterface
* This object.
*/
public function setWeight($weight);
/**
* Returns widget form.
*
* @param array $original_form
* Entire form bult up to this point. Form elements for widget should generally
* not be added directly to it but returned from funciton as a separated
* unit.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* Form state object.
* @param array $additional_widget_parameters
* Additional parameters that we want to pass to the widget.
*
* @return array
* Form structure.
*/
public function getForm(array &$original_form, FormStateInterface $form_state, array $additional_widget_parameters);
/**
* Validates form.
*
* @param array $form
* Form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* Form state object.
*/
public function validate(array &$form, FormStateInterface $form_state);
/**
* Submits form.
*
* @param array $element
* Widget part of the form.
* @param array $form
* Form.
* @param \Drupal\Core\Form\FormStateInterface $form_state
* Form state object.
*/
public function submit(array &$element, array &$form, FormStateInterface $form_state);
/**
* Returns if widget requires JS commands support by selection display.
*
* @return bool
* True is auto selection is enabled and add/remove of entities will be done
* over javascript events on selection display.
*/
public function requiresJsCommands();
/**
* Defines if the widget is visible / accessible in a given context.
*
* @return \Drupal\Core\Access\AccessResultInterface
* The access result.
*/
public function access();
}
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 |
DependentPluginInterface:: |
public | function | Calculates dependencies for the configured plugin. | 19 |
PluginFormInterface:: |
public | function | Form constructor. | 36 |
PluginFormInterface:: |
public | function | Form submission handler. | 32 |
PluginFormInterface:: |
public | function | Form validation handler. | 18 |
PluginInspectionInterface:: |
public | function | Gets the definition of the plugin implementation. | 4 |
PluginInspectionInterface:: |
public | function | Gets the plugin_id of the plugin instance. | 2 |
WidgetInterface:: |
public | function | Defines if the widget is visible / accessible in a given context. | 1 |
WidgetInterface:: |
public | function | Returns widget form. | 1 |
WidgetInterface:: |
public | function | Returns the widget's weight. | 1 |
WidgetInterface:: |
public | function | Returns the widget id. | 1 |
WidgetInterface:: |
public | function | Returns the widget label. | 1 |
WidgetInterface:: |
public | function | Returns if widget requires JS commands support by selection display. | 1 |
WidgetInterface:: |
public | function | Sets the widget's label. | 1 |
WidgetInterface:: |
public | function | Sets the widget's weight. | 1 |
WidgetInterface:: |
public | function | Submits form. | 1 |
WidgetInterface:: |
public | function | Returns the widget UUID. | 1 |
WidgetInterface:: |
public | function | Validates form. | 1 |