interface InPlaceEditorInterface implements PluginInspectionInterface (View source)

Defines an interface for in-place editors plugins.

Methods

string
getPluginId()

Gets the plugin_id of the plugin instance.

array
getPluginDefinition()

Gets the definition of the plugin implementation.

bool
isCompatible(FieldItemListInterface $items)

Checks whether this in-place editor is compatible with a given field.

array
getMetadata(FieldItemListInterface $items)

Generates metadata that is needed specifically for this editor.

array
getAttachments()

Returns the attachments for this editor.

Details

string getPluginId()

Gets the plugin_id of the plugin instance.

Return Value

string

The plugin_id of the plugin instance.

array getPluginDefinition()

Gets the definition of the plugin implementation.

Return Value

array

The plugin definition, as returned by the discovery object used by the plugin manager.

bool isCompatible(FieldItemListInterface $items)

Checks whether this in-place editor is compatible with a given field.

Parameters

FieldItemListInterface $items

The field values to be in-place edited.

Return Value

bool

TRUE if it is compatible, FALSE otherwise.

array getMetadata(FieldItemListInterface $items)

Generates metadata that is needed specifically for this editor.

Will only be called by \Drupal\quickedit\MetadataGeneratorInterface::generate() when the passed in field & item values will use this editor.

Parameters

FieldItemListInterface $items

The field values to be in-place edited.

Return Value

array

A keyed array with metadata. Each key should be prefixed with the plugin ID of the editor.

array getAttachments()

Returns the attachments for this editor.

Return Value

array

An array of attachments, for use with #attached.

See also

AttachmentsResponseProcessorInterface::processAttachments