make api call work for TwingleProject & TwingleEvent
This commit is contained in:
parent
aaba5ce953
commit
1df6230bad
1 changed files with 11 additions and 5 deletions
|
@ -64,11 +64,17 @@ abstract class CRM_TwingleCampaign_BAO_Campaign {
|
||||||
|
|
||||||
$single = FALSE;
|
$single = FALSE;
|
||||||
|
|
||||||
$result = civicrm_api3($this->className, 'get', [
|
$query = ['sequential' => 1,];
|
||||||
'sequential' => 1,
|
|
||||||
'is_active' => 1,
|
switch($this->className) {
|
||||||
'project_id' => $this->values['id'],
|
case 'TwingleProject':
|
||||||
]);
|
$query['project_id'] = $this->values['id'];
|
||||||
|
break;
|
||||||
|
case 'TwingleEvent':
|
||||||
|
$query['event_id'] = $this->values['id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = civicrm_api3($this->className, 'get', $query);
|
||||||
|
|
||||||
// If there is more than one campaign for this entity, handle the duplicates
|
// If there is more than one campaign for this entity, handle the duplicates
|
||||||
if ($result['count'] > 1) {
|
if ($result['count'] > 1) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue