X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FMailingContact.php;h=b3f2d8bb2608234716260d5a95d40f343820564c;hb=ac439a0617d2a9d7bf661b615928a6f50c3ad5a9;hp=c001039b1a51ccb1ab59e4c3d7b1f15208069073;hpb=8282c3dc7b991acb4665546aae5c18e1adaecf95;p=civicrm-core.git diff --git a/api/v3/MailingContact.php b/api/v3/MailingContact.php index c001039b1a..b3f2d8bb26 100644 --- a/api/v3/MailingContact.php +++ b/api/v3/MailingContact.php @@ -1,27 +1,11 @@ 1, 'title' => 'Contact ID', 'type' => CRM_Utils_Type::T_INT, - ); + ]; - $params['type'] = array( + $params['type'] = [ 'api.default' => 'Delivered', - 'title' => 'Type', // doesn't really explain the field - but not sure I understand it to explain it better + // doesn't really explain the field - but not sure I understand it to explain it better + 'title' => 'Type', 'type' => CRM_Utils_Type::T_STRING, - 'options' => array( + 'options' => [ 'Delivered' => 'Delivered', 'Bounced' => 'Bounced', - ), - ); + ], + ]; } /** @@ -131,20 +116,20 @@ AND meq.contact_id = %1 GROUP BY m.id "; - $qParams = array( - 1 => array($contactID, 'Integer'), - ); + $qParams = [ + 1 => [$contactID, 'Integer'], + ]; $dao = CRM_Core_DAO::executeQuery($sql, $qParams); $results = $dao->N; } else { - $defaultFields = array( + $defaultFields = [ 'm.id' => 'mailing_id', 'm.subject' => 'subject', 'c.id' => 'creator_id', 'c.sort_name' => 'creator_name', - ); + ]; if ($selectFields) { $fields = array_merge($selectFields, $defaultFields); @@ -153,7 +138,7 @@ GROUP BY m.id $fields = $defaultFields; } - $select = array(); + $select = []; foreach ($fields as $n => $l) { $select[] = "$n as $l"; } @@ -186,14 +171,14 @@ LIMIT %2, %3 "; } - $qParams = array( - 1 => array($contactID, 'Integer'), - 2 => array($offset, 'Integer'), - 3 => array($limit, 'Integer'), - ); + $qParams = [ + 1 => [$contactID, 'Integer'], + 2 => [$offset, 'Integer'], + 3 => [$limit, 'Integer'], + ]; $dao = CRM_Core_DAO::executeQuery($sql, $qParams); - $results = array(); + $results = []; while ($dao->fetch()) { foreach ($fields as $n => $l) { $results[$dao->mailing_id][$l] = $dao->$l; @@ -222,7 +207,7 @@ function _civicrm_api3_mailing_contact_get_delivered( $sort, $getCount ) { - $selectFields = array('med.time_stamp' => 'start_date'); + $selectFields = ['med.time_stamp' => 'start_date']; $fromClause = " INNER JOIN civicrm_mailing_event_delivered med ON med.event_queue_id = meq.id