forked from backdrop-contrib/paragraphs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParagraphsItemMetadataController.inc
More file actions
33 lines (26 loc) · 966 Bytes
/
ParagraphsItemMetadataController.inc
File metadata and controls
33 lines (26 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
* @file
* Entity metadata implementation for the paragraphs entity.
*/
class ParagraphsItemMetadataController extends EntityDefaultMetadataController {
/**
* Generate basic metadata for a paragraphs item.
*/
public function entityPropertyInfo() {
$info = parent::entityPropertyInfo();
$properties = &$info['paragraphs_item']['properties'];
$properties['field_name']['label'] = t('Field name');
$properties['field_name']['description'] = t('The machine-readable name of the paragraphs field containing this item.');
$properties['field_name']['required'] = TRUE;
$properties['host_entity'] = array(
'label' => t('Host entity'),
'type' => 'entity',
'description' => t('The entity containing the paragraphs field.'),
'getter callback' => 'paragraphs_item_get_host_entity',
'setter callback' => 'paragraphs_item_set_host_entity',
'required' => TRUE,
);
return $info;
}
}