function drush_replicate_drush_entity_by_ids in Replicate 7
Same name and namespace in other branches
- 8 replicate.drush.inc \drush_replicate_drush_entity_by_ids()
Command callback to replicate entities.
File
- ./
replicate.drush.inc, line 46 - Replicate entities via drush framework.
Code
function drush_replicate_drush_entity_by_ids($entity_type = NULL, $ids = NULL) {
$original_ids = explode(',', $ids);
foreach ($original_ids as $original_id) {
$entity_id = replicate_entity_by_id($entity_type, $original_id);
if (!empty($entity_id)) {
drush_log(dt('@entity_type @entity_id is clone of @entity_type @original_id', array(
'@entity_type' => $entity_type,
'@entity_id' => $entity_id,
'@original_id' => (int) $original_id,
)), 'success');
}
else {
drush_log(dt('Impossible to replicate @entity_type @original_id', array(
'@entity_type' => $entity_type,
'@original_id' => check_plain($original_id),
)), 'error');
}
}
}