<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
$mailing->is_completed = 1;
$mailing->save();
- $job = new CRM_Mailing_BAO_Job();
+ $job = new CRM_Mailing_BAO_MailingJob();
$job->mailing_id = $mailing->id;
$job->scheduled_date = generateRandomDate();
$job->start_date = generateRandomDate();
$job->status = 'Complete';
$job->save();
- $group = new CRM_Mailing_DAO_Group();
+ $group = new CRM_Mailing_DAO_MailingGroup();
$group->mailing_id = $mailing->id;
$group->group_type = 'Include';
$group->entity_table = 'civicrm_group';
$group->save();
}
+/**
+ * @return string
+ */
function generateRandomDate() {
$year = 2006 + mt_rand(0, 2);
$month = 1 + mt_rand(0, 11);