<?php
-
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* @subpackage API_MailingAB
* @copyright CiviCRM LLC (c) 2004-2014
* $Id$
- *
- */
-
-/**
- * Files required for this package
*/
/**
- * Handle a create mailing ab testing
+ * Handle a create mailing ab testing.
*
* @param array $params
- * @param array $ids
*
- * @return array API Success Array
+ * @return array
+ * API Success Array
*/
function civicrm_api3_mailing_a_b_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
* Handle a delete event.
*
* @param array $params
- * @param array $ids
*
- * @return array API Success Array
+ * @return array
+ * API Success Array
*/
function civicrm_api3_mailing_a_b_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
* Handle a get event.
*
* @param array $params
+ *
* @return array
*/
function civicrm_api3_mailing_a_b_get($params) {
}
/**
- * Adjust Metadata for submit action
+ * Adjust Metadata for submit action.
+ *
+ * The metadata is used for setting defaults, documentation & validation.
*
- * The metadata is used for setting defaults, documentation & validation
* @param array $params
* Array or parameters determined by getfields.
*/
}
/**
- * Send A/B mail to A/B recipients respectively
+ * Send A/B mail to A/B recipients respectively.
*
* @param array $params
+ *
* @return array
* @throws API_Exception
*/
}
/**
- * Adjust Metadata for graph_stats action
+ * Adjust Metadata for graph_stats action.
+ *
+ * The metadata is used for setting defaults, documentation & validation.
*
- * The metadata is used for setting defaults, documentation & validation
* @param array $params
* Array or parameters determined by getfields.
*/
}
/**
- * Send graph detail for A/B tests mail
+ * Send graph detail for A/B tests mail.
*
* @param array $params
+ *
* @return array
* @throws API_Exception
*/
$graphStats[$name] = array(
$params['split_count_select'] => array(
'count' => CRM_Mailing_Event_BAO_Opened::getTotalCount($mailingAB[$column], NULL, TRUE, $toDate),
- 'time' => CRM_Utils_Date::customFormat($toDate)
- )
+ 'time' => CRM_Utils_Date::customFormat($toDate),
+ ),
);
break;
+
case 'total unique clicks':
$result = CRM_Mailing_Event_BAO_TrackableURLOpen::getRows($mailingAB['mailing_id_a'], NULL, TRUE, 0, 1, "civicrm_mailing_event_trackable_url_open.time_stamp ASC");
$startDate = CRM_Utils_Date::processDate($result[0]['date']);
$graphStats[$name] = array(
$params['split_count_select'] => array(
'count' => CRM_Mailing_Event_BAO_TrackableURLOpen::getTotalCount($params['mailing_id'], NULL, FALSE, NULL, $toDate),
- 'time' => CRM_Utils_Date::customFormat($toDate)
- )
+ 'time' => CRM_Utils_Date::customFormat($toDate),
+ ),
);
break;
+
case 'total clicks on a particular link':
if (empty($params['target_url'])) {
throw new API_Exception("Provide url to get stats result for total clicks on a particular link");
$graphStats[$name] = array(
$params['split_count_select'] => array(
'count' => CRM_Mailing_Event_BAO_TrackableURLOpen::getTotalCount($params['mailing_id'], NULL, FALSE, $url_id, $toDate),
- 'time' => CRM_Utils_Date::customFormat($toDate)
- )
+ 'time' => CRM_Utils_Date::customFormat($toDate),
+ ),
);
break;
}