You are here

interface InPlaceEditorInterface in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/quickedit/src/Plugin/InPlaceEditorInterface.php \Drupal\quickedit\Plugin\InPlaceEditorInterface

Defines an interface for in-place editors plugins.

Hierarchy

Expanded class hierarchy of InPlaceEditorInterface

All classes that implement InPlaceEditorInterface

See also

\Drupal\quickedit\Annotation\InPlaceEditor

\Drupal\quickedit\Plugin\InPlaceEditorBase

\Drupal\quickedit\Plugin\InPlaceEditorManager

Plugin API

1 file declares its use of InPlaceEditorInterface
Editor.php in core/modules/editor/src/Plugin/InPlaceEditor/Editor.php

File

core/modules/quickedit/src/Plugin/InPlaceEditorInterface.php, line 16

Namespace

Drupal\quickedit\Plugin
View source
interface InPlaceEditorInterface extends PluginInspectionInterface {

  /**
   * Checks whether this in-place editor is compatible with a given field.
   *
   * @param \Drupal\Core\Field\FieldItemListInterface $items
   *   The field values to be in-place edited.
   *
   * @return bool
   *   TRUE if it is compatible, FALSE otherwise.
   */
  public function isCompatible(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.
   *
   * @param \Drupal\Core\Field\FieldItemListInterface $items
   *   The field values to be in-place edited.
   *
   * @return array
   *   A keyed array with metadata. Each key should be prefixed with the plugin
   *   ID of the editor.
   */
  public function getMetadata(FieldItemListInterface $items);

  /**
   * Returns the attachments for this editor.
   *
   * @return array
   *   An array of attachments, for use with #attached.
   *
   * @see \Drupal\Core\Render\AttachmentsResponseProcessorInterface::processAttachments()
   */
  public function getAttachments();

}

Members

Namesort descending Modifiers Type Description Overrides
InPlaceEditorInterface::getAttachments public function Returns the attachments for this editor. 5
InPlaceEditorInterface::getMetadata public function Generates metadata that is needed specifically for this editor. 2
InPlaceEditorInterface::isCompatible public function Checks whether this in-place editor is compatible with a given field. 5
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2