field_collection.info.inc 936 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * @file
  4. * Provides entity property info for field collection items.
  5. */
  6. class FieldCollectionItemMetadataController extends EntityDefaultMetadataController {
  7. public function entityPropertyInfo() {
  8. $info = parent::entityPropertyInfo();
  9. $properties = &$info['field_collection_item']['properties'];
  10. $properties['field_name']['label'] = t('Field name');
  11. $properties['field_name']['description'] = t('The machine-readable name of the field collection field containing this item.');
  12. $properties['field_name']['required'] = TRUE;
  13. $properties['host_entity'] = array(
  14. 'label' => t('Host entity'),
  15. 'type' => 'entity',
  16. 'description' => t('The entity containing the field collection field.'),
  17. 'getter callback' => 'field_collection_item_get_host_entity',
  18. 'setter callback' => 'field_collection_item_set_host_entity',
  19. 'required' => TRUE,
  20. );
  21. return $info;
  22. }
  23. }