diff options
Diffstat (limited to 'app/Model/ProjectMetadata.php')
-rw-r--r-- | app/Model/ProjectMetadata.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/Model/ProjectMetadata.php b/app/Model/ProjectMetadata.php index 85498053..256f5e1f 100644 --- a/app/Model/ProjectMetadata.php +++ b/app/Model/ProjectMetadata.php @@ -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; + } } |