Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / quickedit / src / EditorSelectorInterface.php
1 <?php
2
3 namespace Drupal\quickedit;
4
5 use Drupal\Core\Field\FieldItemListInterface;
6
7 /**
8  * Interface for selecting an in-place editor (an Editor plugin) for a field.
9  */
10 interface EditorSelectorInterface {
11
12   /**
13    * Returns the in-place editor (an InPlaceEditor plugin) to use for a field.
14    *
15    * @param string $formatter_type
16    *   The field's formatter type name.
17    * @param \Drupal\Core\Field\FieldItemListInterface $items
18    *   The field values to be in-place edited.
19    *
20    * @return string|null
21    *   The editor to use, or NULL to not enable in-place editing.
22    */
23   public function getEditor($formatter_type, FieldItemListInterface $items);
24
25   /**
26    * Returns the attachments for all editors.
27    *
28    * @param array $editor_ids
29    *   A list of all in-place editor IDs that should be attached.
30    *
31    * @return array
32    *   An array of attachments, for use with #attached.
33    *
34    * @see \Drupal\Core\Render\AttachmentsResponseProcessorInterface::processAttachments()
35    */
36   public function getEditorAttachments(array $editor_ids);
37
38 }