implement TwingleProject cloning

This commit is contained in:
Marc Michalsky forumZFD 2021-02-01 14:30:32 +01:00
parent 247874f380
commit 9df3ff4153
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9
2 changed files with 45 additions and 4 deletions

View file

@ -107,7 +107,20 @@ class CRM_TwingleCampaign_BAO_TwingleProject extends Campaign {
/**
* Translate values between CiviCRM Campaigns and Twingle format
* ## Clone this TwingleProject
*
* This method removes the id and the identifier from this instance and in
* the next step it pushes the clone as a new project with the same values to
* Twingle.
*
* @throws \Exception
*/
public function clone() {
unset($this->values['id']);
unset($this->values['identifier']);
$this->create(); // this will also trigger the postSave hook
}
*
* @param array $values
* array of which values shall be translated