+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017 |
+ | Copyright CiviCRM LLC (c) 2004-2019 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
* Array of parameters determined by getfields.
*/
function _civicrm_api3_mailing_contact_get_spec(&$params) {
- $params['contact_id'] = array(
+ $params['contact_id'] = [
'api.required' => 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',
- ),
- );
+ ],
+ ];
}
/**
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);
$fields = $defaultFields;
}
- $select = array();
+ $select = [];
foreach ($fields as $n => $l) {
$select[] = "$n as $l";
}
";
}
- $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;
$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