<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 5 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019 |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM. |
- | |
- | CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
+ | Copyright CiviCRM LLC. All rights reserved. |
| |
- | CiviCRM is distributed in the hope that it will be useful, but |
- | WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
- | See the GNU Affero General Public License for more details. |
- | |
- | You should have received a copy of the GNU Affero General Public |
- | License and the CiviCRM Licensing Exception along |
- | with this program; if not, contact CiviCRM LLC |
- | at info[AT]civicrm[DOT]org. If you have questions about the |
- | GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ | This work is published under the GNU AGPLv3 license with some |
+ | permitted exceptions and without any warranty. For full license |
+ | and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
* 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