Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / quickedit / src / MetadataGeneratorInterface.php
1 <?php
2
3 namespace Drupal\quickedit;
4
5 use Drupal\Core\Entity\EntityInterface;
6 use Drupal\Core\Field\FieldItemListInterface;
7
8 /**
9  * Interface for generating in-place editing metadata.
10  */
11 interface MetadataGeneratorInterface {
12
13   /**
14    * Generates in-place editing metadata for an entity.
15    *
16    * @param \Drupal\Core\Entity\EntityInterface $entity
17    *   The entity, in the language in which one of its fields is being edited.
18    * @return array
19    *   An array containing metadata with the following keys:
20    *   - label: the user-visible label for the entity in the given language.
21    */
22   public function generateEntityMetadata(EntityInterface $entity);
23
24   /**
25    * Generates in-place editing metadata for an entity field.
26    *
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.
31    * @return array
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.
38    */
39   public function generateFieldMetadata(FieldItemListInterface $items, $view_mode);
40
41 }