implement TwingleProject.delete api
This commit is contained in:
parent
d7930660f3
commit
aef7e71e33
3 changed files with 213 additions and 17 deletions
|
@ -214,6 +214,26 @@ abstract class CRM_TwingleCampaign_BAO_Campaign {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* ## Delete Campaign
|
||||
* Deletes this Campaign from CiviCRM
|
||||
*
|
||||
* @throws CiviCRM_API3_Exception
|
||||
*/
|
||||
public function delete(): bool {
|
||||
|
||||
// Delete campaign via Campaign.delete api
|
||||
if ($this->getId()) {
|
||||
$result = civicrm_api3('Campaign', 'delete',
|
||||
['id' => $this->getId()]);
|
||||
}
|
||||
else {
|
||||
throw new CiviCRM_API3_Exception($this->className . ' not found');
|
||||
}
|
||||
return ($result['is_error'] == 0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ## Deactivate this campaign
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue