You are here

function replicate_entity_by_id in Replicate 7

Replicate the entity corresponding to the type and id passed in argument and save it.

Parameters

string $entity_type: The entity type.

int $id: The unique entity identifier.

Return value

mixed The newly created entity id if the clone has been created and saved, else FALSE.

See also

replicate_entity()

1 call to replicate_entity_by_id()
drush_replicate_drush_entity_by_ids in ./replicate.drush.inc
Command callback to replicate entities.

File

./replicate.module, line 21
Main methods of Replicate module.

Code

function replicate_entity_by_id($entity_type, $id) {
  if (($original = entity_load_single($entity_type, $id)) !== FALSE) {
    return replicate_entity($entity_type, $original);
  }
  return FALSE;
}