projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
version fixes
[civicrm-core.git]
/
api
/
v3
/
MailingContact.php
diff --git
a/api/v3/MailingContact.php
b/api/v3/MailingContact.php
index c6fde4f62e03cdbe32c625014cfdb2776815385a..58c3d93f1a929e407d79af7f75e9a05d2f134519 100644
(file)
--- a/
api/v3/MailingContact.php
+++ b/
api/v3/MailingContact.php
@@
-1,9
+1,9
@@
<?php
/*
+--------------------------------------------------------------------+
<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.
6
|
+ | CiviCRM version 4.
7
|
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-201
4
|
+ | Copyright CiviCRM LLC (c) 2004-201
5
|
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
@@
-26,36
+26,30
@@
*/
/**
*/
/**
- *
File for the CiviCRM APIv3 contact and mailing functions
+ *
This api exposes CiviCRM contact and mailing.
*
* @package CiviCRM_APIv3
*
* @package CiviCRM_APIv3
- * @subpackage API_MailingContact
- *
- * @copyright CiviCRM LLC (c) 2004-2014
- * @version $Id$
- *
*/
/**
*/
/**
- * Get all the mailings and details that a contact was involved with
+ * Get all the mailings and details that a contact was involved with
.
*
* @param array $params
* Input parameters - see _spec for details (returned by getfields)
*
* @return array
* API result
*
* @param array $params
* Input parameters - see _spec for details (returned by getfields)
*
* @return array
* API result
- * @static
- * @access public
- *
*/
function civicrm_api3_mailing_contact_get($params) {
return civicrm_api3_create_success(_civicrm_api3_mailing_contact_getresults($params, FALSE));
}
*/
function civicrm_api3_mailing_contact_get($params) {
return civicrm_api3_create_success(_civicrm_api3_mailing_contact_getresults($params, FALSE));
}
+
/**
/**
- * This is a wrapper for the functions that return the results from the 'quasi-entity'
- *
mailing contact
+ * This is a wrapper for the functions that return the results from the 'quasi-entity'
mailing contact.
+ *
* @param array $params
* @param bool $count
* @param array $params
* @param bool $count
+ *
* @throws Exception
*/
function _civicrm_api3_mailing_contact_getresults($params, $count) {
* @throws Exception
*/
function _civicrm_api3_mailing_contact_getresults($params, $count) {
@@
-63,7
+57,7
@@
function _civicrm_api3_mailing_contact_getresults($params, $count) {
//ie. because the api is an anomaly & passing in id is not valid
throw new Exception('This api call does not accept api as a parameter');
}
//ie. because the api is an anomaly & passing in id is not valid
throw new Exception('This api call does not accept api as a parameter');
}
- $options = _civicrm_api3_get_options_from_params($params, TRUE,
'contribution',
'get');
+ $options = _civicrm_api3_get_options_from_params($params, TRUE,
'contribution',
'get');
$fnName = '_civicrm_api3_mailing_contact_get_' . strtolower($params['type']);
return $fnName(
$params['contact_id'],
$fnName = '_civicrm_api3_mailing_contact_get_' . strtolower($params['type']);
return $fnName(
$params['contact_id'],
@@
-73,18
+67,23
@@
function _civicrm_api3_mailing_contact_getresults($params, $count) {
$count
);
}
$count
);
}
+
/**
/**
- * Adjust Metadata for Get action
+ * Adjust Metadata for Get action
.
*
* @param array $params
*
* @param array $params
- * Array o
r
parameters determined by getfields.
+ * Array o
f
parameters determined by getfields.
*/
function _civicrm_api3_mailing_contact_get_spec(&$params) {
*/
function _civicrm_api3_mailing_contact_get_spec(&$params) {
- $params['contact_id']['api.required'] = 1;
- $params['contact_id']['title'] = 'Contact ID';
+ $params['contact_id'] = array(
+ 'api.required' => 1,
+ 'title' => 'Contact ID',
+ 'type' => CRM_Utils_Type::T_INT,
+ );
+
$params['type'] = array(
'api.default' => 'Delivered',
$params['type'] = array(
'api.default' => 'Delivered',
- 'title' => 'Type',// doesn't really explain the field - but not sure I understand it to explain it better
+ 'title' => 'Type',
// doesn't really explain the field - but not sure I understand it to explain it better
'type' => CRM_Utils_Type::T_STRING,
'options' => array(
'Delivered' => 'Delivered',
'type' => CRM_Utils_Type::T_STRING,
'options' => array(
'Delivered' => 'Delivered',
@@
-94,6
+93,8
@@
function _civicrm_api3_mailing_contact_get_spec(&$params) {
}
/**
}
/**
+ * Helper function for mailing contact queries.
+ *
* @param int $contactID
* @param $offset
* @param $limit
* @param int $contactID
* @param $offset
* @param $limit
@@
-202,6
+203,8
@@
LIMIT %2, %3
}
/**
}
/**
+ * Get delivered mailing contacts.
+ *
* @param int $contactID
* @param $offset
* @param $limit
* @param int $contactID
* @param $offset
* @param $limit
@@
-241,6
+244,8
@@
AND meb.id IS NULL
}
/**
}
/**
+ * Get bounced mailing contact records.
+ *
* @param int $contactID
* @param $offset
* @param $limit
* @param int $contactID
* @param $offset
* @param $limit
@@
-273,17
+278,13
@@
INNER JOIN civicrm_mailing_event_bounce meb ON meb.event_queue_id = meq.id
}
/**
}
/**
- * Get count of all the mailings that a contact was involved with
+ * Get count of all the mailings that a contact was involved with
.
*
* @param array $params
* Input parameters per getfields
*
* @return array
* API result
*
* @param array $params
* Input parameters per getfields
*
* @return array
* API result
- * @static
- * @access public
- * @example CRM/Mailing/BAO/Mailing.php
- *
*/
function civicrm_api3_mailing_contact_getcount($params) {
return _civicrm_api3_mailing_contact_getresults($params, TRUE);
*/
function civicrm_api3_mailing_contact_getcount($params) {
return _civicrm_api3_mailing_contact_getresults($params, TRUE);