Projet

Général

Profil

Paste
Télécharger (937 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / field_collection / field_collection.info.inc @ 950416da

1
<?php
2

    
3
/**
4
 * @file
5
 * Provides entity property info for field collection items.
6
 */
7

    
8
class FieldCollectionItemMetadataController extends EntityDefaultMetadataController {
9

    
10
  public function entityPropertyInfo() {
11
    $info = parent::entityPropertyInfo();
12
    $properties = &$info['field_collection_item']['properties'];
13

    
14
    $properties['field_name']['label'] = t('Field name');
15
    $properties['field_name']['description'] = t('The machine-readable name of the field collection field containing this item.');
16
    $properties['field_name']['required'] = TRUE;
17

    
18
    $properties['host_entity'] = array(
19
      'label' => t('Host entity'),
20
      'type' => 'entity',
21
      'description' => t('The entity containing the field collection field.'),
22
      'getter callback' => 'field_collection_item_get_host_entity',
23
      'setter callback' => 'field_collection_item_set_host_entity',
24
      'required' => TRUE,
25
    );
26

    
27
    return $info;
28
  }
29

    
30
}