diff --git a/api/v3/TwingleSync/models/TwingleProject.php b/api/v3/TwingleSync/models/TwingleProject.php index 43c6068..84a39bf 100644 --- a/api/v3/TwingleSync/models/TwingleProject.php +++ b/api/v3/TwingleSync/models/TwingleProject.php @@ -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() { }