ParagraphsItemMetadataController.inc 947 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * @file
  4. * Entity metadata implementation for the paragraphs entity.
  5. */
  6. /**
  7. * Class ParagraphsItemMetadataController
  8. */
  9. class ParagraphsItemMetadataController extends EntityDefaultMetadataController {
  10. public function entityPropertyInfo() {
  11. $info = parent::entityPropertyInfo();
  12. $properties = &$info['paragraphs']['properties'];
  13. $properties['field_name']['label'] = t('Field name');
  14. $properties['field_name']['description'] = t('The machine-readable name of the paragraphs field containing this item.');
  15. $properties['field_name']['required'] = TRUE;
  16. $properties['host_entity'] = array(
  17. 'label' => t('Host entity'),
  18. 'type' => 'entity',
  19. 'description' => t('The entity containing the paragraphs field.'),
  20. 'getter callback' => 'paragraphs_item_get_host_entity',
  21. 'setter callback' => 'paragraphs_item_set_host_entity',
  22. 'required' => TRUE,
  23. );
  24. return $info;
  25. }
  26. }