add deactivate() function to deactivate a project
This commit is contained in:
parent
a05b671f90
commit
9f2b5c4913
1 changed files with 21 additions and 0 deletions
|
@ -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() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue