Pull merge.
[yaffs-website] / web / core / lib / Drupal / Core / Field / Annotation / FieldFormatter.php
1 <?php
2
3 namespace Drupal\Core\Field\Annotation;
4
5 use Drupal\Component\Annotation\Plugin;
6
7 /**
8  * Defines a FieldFormatter annotation object.
9  *
10  * Formatters handle the display of field values. They are typically
11  * instantiated and invoked by an EntityDisplay object.
12  *
13  * Additional annotation keys for formatters can be defined in
14  * hook_field_formatter_info_alter().
15  *
16  * @Annotation
17  *
18  * @see \Drupal\Core\Field\FormatterPluginManager
19  * @see \Drupal\Core\Field\FormatterInterface
20  *
21  * @ingroup field_formatter
22  */
23 class FieldFormatter extends Plugin {
24
25   /**
26    * The plugin ID.
27    *
28    * @var string
29    */
30   public $id;
31
32   /**
33    * The human-readable name of the formatter type.
34    *
35    * @ingroup plugin_translatable
36    *
37    * @var \Drupal\Core\Annotation\Translation
38    */
39   public $label;
40
41   /**
42    * A short description of the formatter type.
43    *
44    * @ingroup plugin_translatable
45    *
46    * @var \Drupal\Core\Annotation\Translation
47    */
48   public $description;
49
50   /**
51    * The name of the field formatter class.
52    *
53    * This is not provided manually, it will be added by the discovery mechanism.
54    *
55    * @var string
56    */
57   public $class;
58
59   /**
60    * An array of field types the formatter supports.
61    *
62    * @var array
63    */
64   public $field_types = [];
65
66   /**
67    * An integer to determine the weight of this formatter relative to other
68    * formatter in the Field UI when selecting a formatter for a given field
69    * instance.
70    *
71    * @var int optional
72    */
73   public $weight = NULL;
74
75 }