You are here

function hook_replicate_field_FIELD_TYPE in Replicate 7

Manage the replication of a specific field type.

May be used to manage the replication of custom field type, for example node references.

Parameters

object $replica: Reference to the fully loaded entity object being saved (the clone) that can be altered as needed.

string $entity_type: Type of the entity containing the field.

string $field_name: Name of the field that is going to be processed.

See also

replicate_clone_entity()

File

./replicate.api.php, line 96
API documentation for the Replicate module.

Code

function hook_replicate_field_FIELD_TYPE(&$replica, $entity_type, $field_name) {

  // Simplified example from Replicate Field Collection module.
  // Manage the replication of a Field Collection field with a custom function.
  foreach ($replica->{$field_name} as $language => $values) {
    my_custom_function_to_clone_field_collections($replica, $entity_type, $field_name, $language);
  }
}