/**
* Class constructor
*/
- function __construct() {
+ public function __construct() {
parent::__construct();
}
/**
* Register an open event
*
- * @param int $queue_id The Queue Event ID of the recipient
+ * @param int $queue_id
+ * The Queue Event ID of the recipient.
*
* @return void
- * @access public
- * @static
*/
public static function open($queue_id) {
/* First make sure there's a matching queue event */
$q = new CRM_Mailing_Event_BAO_Queue();
$q->id = $queue_id;
if ($q->find(TRUE)) {
- $oe = new CRM_Mailing_Event_BAO_Opened();
+ $oe = new CRM_Mailing_Event_BAO_Opened();
$oe->event_queue_id = $queue_id;
- $oe->time_stamp = date('YmdHis');
+ $oe->time_stamp = date('YmdHis');
$oe->save();
$success = TRUE;
}
/**
* Get row count for the event selector
*
- * @param int $mailing_id ID of the mailing
- * @param int $job_id Optional ID of a job to filter on
- * @param boolean $is_distinct Group by queue ID?
+ * @param int $mailing_id
+ * ID of the mailing.
+ * @param int $job_id
+ * Optional ID of a job to filter on.
+ * @param bool $is_distinct
+ * Group by queue ID?.
*
- * @return int Number of rows in result set
- * @access public
- * @static
+ * @return int
+ * Number of rows in result set
*/
- public static function getTotalCount($mailing_id,
+ public static function getTotalCount(
+ $mailing_id,
$job_id = NULL,
$is_distinct = FALSE,
$toDate = NULL
) {
$dao = new CRM_Core_DAO();
- $open = self::getTableName();
- $queue = CRM_Mailing_Event_BAO_Queue::getTableName();
+ $open = self::getTableName();
+ $queue = CRM_Mailing_Event_BAO_Queue::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
- $job = CRM_Mailing_BAO_MailingJob::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$query = "
SELECT COUNT($open.id) as opened
*
* @param $mailingIDs
*
- * @return array Opened count per mailing ID
- * @access public
- * @static
+ * @return array
+ * Opened count per mailing ID
*/
public static function getMailingTotalCount($mailingIDs) {
$dao = new CRM_Core_DAO();
$openedCount = array();
- $open = self::getTableName();
- $queue = CRM_Mailing_Event_BAO_Queue::getTableName();
- $job = CRM_Mailing_BAO_MailingJob::getTableName();
+ $open = self::getTableName();
+ $queue = CRM_Mailing_Event_BAO_Queue::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$mailingIDs = implode(',', $mailingIDs);
$query = "
$dao->query($query);
- while ( $dao->fetch() ) {
+ while ($dao->fetch()) {
$openedCount[$dao->mailingID] = $dao->opened;
}
return $openedCount;
/**
* Get opened count for each mailing for a given set of mailing IDs and a specific contact
*
- * @param int $mailingIDs IDs of the mailing (comma separated)
- * @param int $contactID ID of the contact
+ * @param int $mailingIDs
+ * IDs of the mailing (comma separated).
+ * @param int $contactID
+ * ID of the contact.
*
- * @return array Count per mailing ID
- * @access public
- * @static
+ * @return array
+ * Count per mailing ID
*/
public static function getMailingContactCount($mailingIDs, $contactID) {
$dao = new CRM_Core_DAO();
$dao->query($query);
- while ( $dao->fetch() ) {
+ while ($dao->fetch()) {
$openedCount[$dao->mailingID] = $dao->opened;
}
/**
* Get rows for the event browser
*
- * @param int $mailing_id ID of the mailing
- * @param int $job_id optional ID of the job
- * @param boolean $is_distinct Group by queue id?
- * @param int $offset Offset
- * @param int $rowCount Number of rows
- * @param array $sort sort array
+ * @param int $mailing_id
+ * ID of the mailing.
+ * @param int $job_id
+ * Optional ID of the job.
+ * @param bool $is_distinct
+ * Group by queue id?.
+ * @param int $offset
+ * Offset.
+ * @param int $rowCount
+ * Number of rows.
+ * @param array $sort
+ * Sort array.
*
* @param int $contact_id
*
- * @return array Result set
- * @access public
- * @static
+ * @return array
+ * Result set
*/
- public static function &getRows($mailing_id, $job_id = NULL,
- $is_distinct = FALSE, $offset = NULL, $rowCount = NULL, $sort = NULL, $contact_id= NULL
+ public static function &getRows(
+ $mailing_id, $job_id = NULL,
+ $is_distinct = FALSE, $offset = NULL, $rowCount = NULL, $sort = NULL, $contact_id = NULL
) {
$dao = new CRM_Core_Dao();
- $open = self::getTableName();
- $queue = CRM_Mailing_Event_BAO_Queue::getTableName();
+ $open = self::getTableName();
+ $queue = CRM_Mailing_Event_BAO_Queue::getTableName();
$mailing = CRM_Mailing_BAO_Mailing::getTableName();
- $job = CRM_Mailing_BAO_MailingJob::getTableName();
+ $job = CRM_Mailing_BAO_MailingJob::getTableName();
$contact = CRM_Contact_BAO_Contact::getTableName();
- $email = CRM_Core_BAO_Email::getTableName();
+ $email = CRM_Core_BAO_Email::getTableName();
$query = "
SELECT $contact.display_name as display_name,