Defines an interface for in-place editors (Create.js PropertyEditor widgets).
A PropertyEditor widget is a user-facing interface to edit an entity property through Create.js.
Expanded class hierarchy of EditPluginInterface
All classes that implement EditPluginInterface
interface EditPluginInterface extends PluginInspectionInterface {
/**
* Checks whether this editor is compatible with a given field instance.
*
* @param \Drupal\field\Plugin\Core\Entity\FieldInstance $instance
* The field instance of the field being edited.
* @param array $items
* The field's item values.
*
* @return bool
* TRUE if it is compatible, FALSE otherwise.
*/
public function isCompatible(FieldInstance $instance, array $items);
/**
* Generates metadata that is needed specifically for this editor.
*
* Will only be called by \Drupal\edit\MetadataGeneratorInterface::generate()
* when the passed in field instance & item values will use this editor.
*
* @param \Drupal\field\Plugin\Core\Entity\FieldInstance $instance
* The field instance of the field being edited.
* @param array $items
* The field's item values.
*
* @return array
* A keyed array with metadata. Each key should be prefixed with the plugin
* ID of the editor.
*/
public function getMetadata(FieldInstance $instance, array $items);
/**
* Returns the attachments for this editor.
*
* @return array
* An array of attachments, for use with #attached.
*
* @see drupal_process_attached()
*/
public function getAttachments();
}
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EditPluginInterface:: |
public | function | Returns the attachments for this editor. | 4 |
EditPluginInterface:: |
public | function | Generates metadata that is needed specifically for this editor. | 2 |
EditPluginInterface:: |
public | function | Checks whether this editor is compatible with a given field instance. | 4 |
PluginInspectionInterface:: |
public | function | Returns the definition of the plugin implementation. | 1 |
PluginInspectionInterface:: |
public | function | Returns the plugin_id of the plugin instance. | 1 |