Duplicate project metadata when duplicating project (#2074)
This commit is contained in:
committed by
Frédéric Guillot
parent
754b2bf1f0
commit
58ccf9f692
@@ -27,4 +27,23 @@ class ProjectMetadata extends Metadata
|
||||
{
|
||||
return 'project_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to duplicate all metadata to another project
|
||||
*
|
||||
* @access public
|
||||
* @param integer $src_project_id
|
||||
* @param integer $dst_project_id
|
||||
* @return boolean
|
||||
*/
|
||||
public function duplicate($src_project_id, $dst_project_id)
|
||||
{
|
||||
$metadata = $this->getAll($src_project_id);
|
||||
|
||||
if (! $this->save($dst_project_id, $metadata)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user