You are here

function relation_add_entity_property_info_alter in Relation add 7

Implements hook_entity_property_info_alter().

File

./relation_add.module, line 1343
Relation Add module file.

Code

function relation_add_entity_property_info_alter(&$info) {
  $fields = field_read_fields(array(
    'type' => 'relation_add',
  ));
  foreach ($fields as $field_name => $field) {
    $field_type = field_info_field_types($field['type']);
    $field_type['property_type'] = 'relation';
    $field_info = field_info_field($field_name);
    foreach ($field_info['bundles'] as $entity_type => $entity_bundles) {
      foreach ($entity_bundles as $bundle) {
        $instance = field_info_instance($entity_type, $field_name, $bundle);
        entity_metadata_field_default_property_callback($info, $entity_type, $field, $instance, $field_type);
        $info[$entity_type]['bundles'][$bundle]['properties'][$field_name]['getter callback'] = 'relation_add_get_relation';
      }
    }
  }
}