class Editor extends PluginBase implements InPlaceEditorInterface (View source)

Defines the formatted text in-place editor.

Constants

DERIVATIVE_SEPARATOR

A string which is used to separate base plugin IDs from the derivative ID.

Properties

protected string $pluginId

The plugin_id.

from  PluginBase
protected array $pluginDefinition

The plugin implementation definition.

from  PluginBase
protected array $configuration

Configuration information passed into the plugin.

from  PluginBase

Methods

__construct(array $configuration, string $plugin_id, mixed $plugin_definition)

Constructs a \Drupal\Component\Plugin\PluginBase object.

string
getPluginId()

Gets the plugin_id of the plugin instance.

string
getBaseId()

Gets the base_plugin_id of the plugin instance.

string|null
getDerivativeId()

Gets the derivative_id of the plugin instance.

array
getPluginDefinition()

Gets the definition of the plugin implementation.

bool
isConfigurable()

Determines if the plugin is configurable.

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.

bool
textFormatHasTransformationFilters(int $format_id)

Returns whether the text format has transformation filters.

array
getAttachments()

Returns the attachments for this editor.

Details

__construct(array $configuration, string $plugin_id, mixed $plugin_definition)

Constructs a \Drupal\Component\Plugin\PluginBase object.

Parameters

array $configuration

A configuration array containing information about the plugin instance.

string $plugin_id

The plugin_id for the plugin instance.

mixed $plugin_definition

The plugin implementation definition.

string getPluginId()

Gets the plugin_id of the plugin instance.

Return Value

string

The plugin_id of the plugin instance.

string getBaseId()

Gets the base_plugin_id of the plugin instance.

Return Value

string

The base_plugin_id of the plugin instance.

string|null getDerivativeId()

Gets the derivative_id of the plugin instance.

Return Value

string|null

The derivative_id of the plugin instance NULL otherwise.

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 isConfigurable()

Determines if the plugin is configurable.

Return Value

bool

A boolean indicating whether the plugin is configurable.

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.

protected bool textFormatHasTransformationFilters(int $format_id)

Returns whether the text format has transformation filters.

Parameters

int $format_id

A text format ID.

Return Value

bool

array getAttachments()

Returns the attachments for this editor.

Return Value

array

An array of attachments, for use with #attached.