add deactivate() function to deactivate a project

This commit is contained in:
Marc Michalsky forumZFD 2020-09-29 14:15:34 +02:00
parent a05b671f90
commit 9f2b5c4913
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9

View file

@ -271,6 +271,27 @@ class TwingleProject {
} }
} }
/**
* Deactivate a project
*
* @return bool
* @throws \CiviCRM_API3_Exception
*/
public function deactivate() {
$result = civicrm_api3('Campaign', 'create', [
'title' => $this->values['title'],
'id' => $this->id,
'is_active' => '0',
]);
if ($result['is_error'] == 0) {
return TRUE;
}
else {
return FALSE;
}
}
public function syncSettings() { public function syncSettings() {
} }