EditorSelectorInterface.php 1006 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
<?php

/**
 * @file
 * Contains \Drupal\edit\EditorSelectorInterface.
 */

namespace Drupal\edit;

10
use Drupal\field\Plugin\Core\Entity\FieldInstance;
11
12

/**
13
 * Interface for selecting an in-place editor (an Editor plugin) for a field.
14
15
16
17
 */
interface EditorSelectorInterface {

  /**
18
   * Returns the in-place editor (an Editor plugin) to use for a field.
19
20
21
   *
   * @param string $formatter_type
   *   The field's formatter type name.
22
   * @param \Drupal\field\Plugin\Core\Entity\FieldInstance $instance
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
   *   The field's instance info.
   * @param array $items
   *   The field's item values.
   *
   * @return string|NULL
   *   The editor to use, or NULL to not enable in-place editing.
   */
  public function getEditor($formatter_type, FieldInstance $instance, array $items);

  /**
   * Returns the attachments for all editors.
   *
   * @return array
   *   An array of attachments, for use with #attached.
   *
   * @see drupal_process_attached()
   */
  public function getAllEditorAttachments();
}