X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FMailing%2FEvent%2FBAO%2FDelivered.php;h=807d5db00ac6f31c4e1277d994cada99e89caa56;hb=fe482240fb0d8a15a50325a36b2854ffbafeffab;hp=f1af54d82253878cdd68f8782b3222dcf61fa06a;hpb=64c2aeba7eea943c799caafed1c82e4f383a1e2d;p=civicrm-core.git diff --git a/CRM/Mailing/Event/BAO/Delivered.php b/CRM/Mailing/Event/BAO/Delivered.php index f1af54d822..807d5db00a 100755 --- a/CRM/Mailing/Event/BAO/Delivered.php +++ b/CRM/Mailing/Event/BAO/Delivered.php @@ -1,7 +1,7 @@ find(TRUE); while ($queue->fetch()) { - $email = new CRM_Core_BAO_Email(); - $email->id = $queue->email_id; - $email->hold_date = ''; + $email = new CRM_Core_BAO_Email(); + $email->id = $queue->email_id; + $email->hold_date = ''; $email->reset_date = date('YmdHis'); $email->save(); } @@ -82,24 +81,26 @@ class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_Delivered { } /** - * Get row count for the event selector + * 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, $job_id = NULL, $is_distinct = FALSE, $toDate = NULL) { $dao = new CRM_Core_DAO(); $delivered = self::getTableName(); - $bounce = CRM_Mailing_Event_BAO_Bounce::getTableName(); - $queue = CRM_Mailing_Event_BAO_Queue::getTableName(); - $mailing = CRM_Mailing_BAO_Mailing::getTableName(); - $job = CRM_Mailing_BAO_MailingJob::getTableName(); + $bounce = CRM_Mailing_Event_BAO_Bounce::getTableName(); + $queue = CRM_Mailing_Event_BAO_Queue::getTableName(); + $mailing = CRM_Mailing_BAO_Mailing::getTableName(); + $job = CRM_Mailing_BAO_MailingJob::getTableName(); $query = " SELECT COUNT($delivered.id) as delivered @@ -139,32 +140,38 @@ class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_Delivered { } /** - * Get rows for the event browser + * 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. * - * @return array Result set - * @access public - * @static + * @return array + * Result set */ - public static function &getRows($mailing_id, $job_id = NULL, + public static function &getRows( + $mailing_id, $job_id = NULL, $is_distinct = FALSE, $offset = NULL, $rowCount = NULL, $sort = NULL, $is_test = 0 ) { $dao = new CRM_Core_Dao(); $delivered = self::getTableName(); - $bounce = CRM_Mailing_Event_BAO_Bounce::getTableName(); - $queue = CRM_Mailing_Event_BAO_Queue::getTableName(); - $mailing = CRM_Mailing_BAO_Mailing::getTableName(); - $job = CRM_Mailing_BAO_MailingJob::getTableName(); - $contact = CRM_Contact_BAO_Contact::getTableName(); - $email = CRM_Core_BAO_Email::getTableName(); + $bounce = CRM_Mailing_Event_BAO_Bounce::getTableName(); + $queue = CRM_Mailing_Event_BAO_Queue::getTableName(); + $mailing = CRM_Mailing_BAO_Mailing::getTableName(); + $job = CRM_Mailing_BAO_MailingJob::getTableName(); + $contact = CRM_Contact_BAO_Contact::getTableName(); + $email = CRM_Core_BAO_Email::getTableName(); $query = " SELECT $delivered.id as id, @@ -237,7 +244,7 @@ class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_Delivered { * @param $eventQueueIDs * @param null $time */ - static function bulkCreate($eventQueueIDs, $time = NULL) { + public static function bulkCreate($eventQueueIDs, $time = NULL) { if (!$time) { $time = date('YmdHis'); } @@ -250,8 +257,8 @@ class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_Delivered { while (!empty($values)) { $input = array_splice($values, 0, CRM_Core_DAO::BULK_INSERT_COUNT); - $str = implode(',', $input); - $sql = "INSERT INTO civicrm_mailing_event_delivered ( event_queue_id, time_stamp ) VALUES $str;"; + $str = implode(',', $input); + $sql = "INSERT INTO civicrm_mailing_event_delivered ( event_queue_id, time_stamp ) VALUES $str;"; CRM_Core_DAO::executeQuery($sql); } } @@ -267,12 +274,13 @@ class CRM_Mailing_Event_BAO_Delivered extends CRM_Mailing_Event_DAO_Delivered { * This function rectifies that by considering all non-test mailing jobs which have completed between $minDays and $maxDays * and setting the resetDate to the date that an email was delivered * - * @param integer $minDays consider mailings that were completed at least $minDays ago - * @param integer $maxDays consider mailings that were completed not more than $maxDays ago + * @param int $minDays + * Consider mailings that were completed at least $minDays ago. + * @param int $maxDays + * Consider mailings that were completed not more than $maxDays ago. * * @return void - * @static - **/ + */ public static function updateEmailResetDate($minDays = 3, $maxDays = 7) { $dao = new CRM_Core_Dao();