You are here

function hook_replicate_entity_ENTITY_TYPE in Replicate 7

Alter the replica of type ENTITY_TYPE.

Use this function to make specific changes to an entity of a given type.

Parameters

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

See also

replicate_clone_entity()

File

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

Code

function hook_replicate_entity_ENTITY_TYPE(&$replica) {

  // Do something specific to this type of entity.
  $wrapper = entity_metadata_wrapper('ENTITY_TYPE', $replica);
  $wrapper->field_my_field
    ->set('This is a replica of a ENTITY_TYPE');
}