1 | <?php |
||
21 | class FileFieldFormatter extends EntityReferenceFieldFormatter { |
||
22 | |||
23 | /** |
||
24 | * {@inheritdoc} |
||
25 | */ |
||
26 | public function getFieldValue() { |
||
27 | $value = parent::getFieldValue(); |
||
28 | $value += array_intersect_key($this->getConfiguration(), array('description' => '')); |
||
29 | return $value; |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | public function defaultConfiguration() { |
||
36 | $defaults = parent::defaultConfiguration(); |
||
37 | // Add support to store file description. |
||
38 | $defaults['description'] = ''; |
||
39 | return $defaults; |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | public function buildConfigurationForm(array $form, FormStateInterface $form_state) { |
||
59 | |||
60 | } |
||
61 |