You are here

function field_collection_features_pipe_field_instance_alter in Field collection 7

Implements hook_features_pipe_COMPONENT_alter() for field_instance objects.

This is used with Features v2.0-beta2 and newer.

File

./field_collection.module, line 1966
Module implementing field collection field type.

Code

function field_collection_features_pipe_field_instance_alter(&$pipe, $data, $export) {

  // Add the fields of the field collection entity to the pipe.
  foreach ($data as $identifier) {
    if (($field = features_field_load($identifier)) && $field['field_config']['type'] === 'field_collection') {
      $fields = field_info_instances('field_collection_item', $field['field_config']['field_name']);
      foreach ($fields as $name => $field) {
        $pipe['field_instance'][] = "{$field['entity_type']}-{$field['bundle']}-{$field['field_name']}";
      }
    }
  }
}