3 namespace Drupal\quickedit;
5 use Drupal\Core\Entity\EntityInterface;
6 use Drupal\Core\Field\FieldItemListInterface;
9 * Interface for generating in-place editing metadata.
11 interface MetadataGeneratorInterface {
14 * Generates in-place editing metadata for an entity.
16 * @param \Drupal\Core\Entity\EntityInterface $entity
17 * The entity, in the language in which one of its fields is being edited.
19 * An array containing metadata with the following keys:
20 * - label: the user-visible label for the entity in the given language.
22 public function generateEntityMetadata(EntityInterface $entity);
25 * Generates in-place editing metadata for an entity field.
27 * @param \Drupal\Core\Field\FieldItemListInterface $items
28 * The field values to be in-place edited.
29 * @param string $view_mode
30 * The view mode the field should be rerendered in.
32 * An array containing metadata with the following keys:
33 * - label: the user-visible label for the field.
34 * - access: whether the current user may edit the field or not.
35 * - editor: which editor should be used for the field.
36 * - aria: the ARIA label.
37 * - custom: (optional) any additional metadata that the editor provides.
39 public function generateFieldMetadata(FieldItemListInterface $items, $view_mode);