function finder_clone in Finder 6
Same name and namespace in other branches
- 7 finder.module \finder_clone()
Write a finder into the database as a new finder.
Parameters
$old_finder: The finder object to clone.
Return value
The new finder object.
1 call to finder_clone()
- finder_admin_import in includes/
finder.admin.inc - Admin finder import page.
File
- ./
finder.module, line 542 - The finder module.
Code
function finder_clone($old_finder) {
$finder = drupal_clone($old_finder);
finder_invoke_finderapi($finder, 'finder_clone');
unset($finder->finder_id);
finder_save($finder);
foreach ($finder->elements as $key => $finder_element) {
unset($finder_element->finder_element_id);
$finder_element->finder_id = $finder->finder_id;
finder_element_save($finder_element);
$finder->elements[$key] = $finder_element;
}
return $finder;
}