3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Mailing/MailingJob.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:c08c4d0fc52564ca707e07af4649231c)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Mailing_DAO_MailingJob constructor.
40 class CRM_Mailing_DAO_MailingJob
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_mailing_job';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
59 * The ID of the mailing this Job will send.
65 * date on which this job was scheduled.
69 public $scheduled_date;
71 * date on which this job was started.
77 * date on which this job ended.
83 * The state of this job
89 * Is this job for a test mail?
95 * Type of mailling job: null | child
107 * Offset of the child job
113 * Queue size limit for each child job
121 function __construct() {
122 $this->__table
= 'civicrm_mailing_job';
123 parent
::__construct();
126 * Returns foreign keys and entity references.
129 * [CRM_Core_Reference_Interface]
131 static function getReferenceColumns() {
132 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
133 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
134 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'mailing_id', 'civicrm_mailing', 'id');
135 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'parent_id', 'civicrm_mailing_job', 'id');
136 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
138 return Civi
::$statics[__CLASS__
]['links'];
141 * Returns all the column names of this table
145 static function &fields() {
146 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
147 Civi
::$statics[__CLASS__
]['fields'] = array(
150 'type' => CRM_Utils_Type
::T_INT
,
151 'title' => ts('Mailing Job ID') ,
153 'table_name' => 'civicrm_mailing_job',
154 'entity' => 'MailingJob',
155 'bao' => 'CRM_Mailing_BAO_MailingJob',
158 'mailing_id' => array(
159 'name' => 'mailing_id',
160 'type' => CRM_Utils_Type
::T_INT
,
161 'title' => ts('Mailing') ,
162 'description' => 'The ID of the mailing this Job will send.',
164 'table_name' => 'civicrm_mailing_job',
165 'entity' => 'MailingJob',
166 'bao' => 'CRM_Mailing_BAO_MailingJob',
168 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
170 'scheduled_date' => array(
171 'name' => 'scheduled_date',
172 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
173 'title' => ts('Mailing Scheduled Date') ,
174 'description' => 'date on which this job was scheduled.',
175 'table_name' => 'civicrm_mailing_job',
176 'entity' => 'MailingJob',
177 'bao' => 'CRM_Mailing_BAO_MailingJob',
180 'start_date' => array(
181 'name' => 'start_date',
182 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
183 'title' => ts('Mailing Job Start Date') ,
184 'description' => 'date on which this job was started.',
185 'table_name' => 'civicrm_mailing_job',
186 'entity' => 'MailingJob',
187 'bao' => 'CRM_Mailing_BAO_MailingJob',
191 'name' => 'end_date',
192 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
193 'title' => ts('Mailing Job End Date') ,
194 'description' => 'date on which this job ended.',
195 'table_name' => 'civicrm_mailing_job',
196 'entity' => 'MailingJob',
197 'bao' => 'CRM_Mailing_BAO_MailingJob',
202 'type' => CRM_Utils_Type
::T_STRING
,
203 'title' => ts('Mailing Job Status') ,
204 'description' => 'The state of this job',
206 'size' => CRM_Utils_Type
::TWELVE
,
207 'table_name' => 'civicrm_mailing_job',
208 'entity' => 'MailingJob',
209 'bao' => 'CRM_Mailing_BAO_MailingJob',
214 'pseudoconstant' => array(
215 'callback' => 'CRM_Core_SelectValues::getMailingJobStatus',
220 'type' => CRM_Utils_Type
::T_BOOLEAN
,
221 'title' => ts('Mailing Job Is Test?') ,
222 'description' => 'Is this job for a test mail?',
223 'table_name' => 'civicrm_mailing_job',
224 'entity' => 'MailingJob',
225 'bao' => 'CRM_Mailing_BAO_MailingJob',
229 'name' => 'job_type',
230 'type' => CRM_Utils_Type
::T_STRING
,
231 'title' => ts('Mailing Job Type') ,
232 'description' => 'Type of mailling job: null | child ',
234 'size' => CRM_Utils_Type
::HUGE
,
235 'table_name' => 'civicrm_mailing_job',
236 'entity' => 'MailingJob',
237 'bao' => 'CRM_Mailing_BAO_MailingJob',
240 'parent_id' => array(
241 'name' => 'parent_id',
242 'type' => CRM_Utils_Type
::T_INT
,
243 'title' => ts('Mailing Job Parent') ,
244 'description' => 'Parent job id',
246 'table_name' => 'civicrm_mailing_job',
247 'entity' => 'MailingJob',
248 'bao' => 'CRM_Mailing_BAO_MailingJob',
250 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
252 'job_offset' => array(
253 'name' => 'job_offset',
254 'type' => CRM_Utils_Type
::T_INT
,
255 'title' => ts('Mailing Job Offset') ,
256 'description' => 'Offset of the child job',
257 'table_name' => 'civicrm_mailing_job',
258 'entity' => 'MailingJob',
259 'bao' => 'CRM_Mailing_BAO_MailingJob',
262 'job_limit' => array(
263 'name' => 'job_limit',
264 'type' => CRM_Utils_Type
::T_INT
,
265 'title' => ts('Mailing Job Limit') ,
266 'description' => 'Queue size limit for each child job',
267 'table_name' => 'civicrm_mailing_job',
268 'entity' => 'MailingJob',
269 'bao' => 'CRM_Mailing_BAO_MailingJob',
273 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
275 return Civi
::$statics[__CLASS__
]['fields'];
278 * Return a mapping from field-name to the corresponding key (as used in fields()).
281 * Array(string $name => string $uniqueName).
283 static function &fieldKeys() {
284 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
285 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
287 return Civi
::$statics[__CLASS__
]['fieldKeys'];
290 * Returns the names of this table
294 static function getTableName() {
295 return self
::$_tableName;
298 * Returns if this table needs to be logged
306 * Returns the list of fields that can be imported
308 * @param bool $prefix
312 static function &import($prefix = false) {
313 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_job', $prefix, array());
317 * Returns the list of fields that can be exported
319 * @param bool $prefix
323 static function &export($prefix = false) {
324 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_job', $prefix, array());
328 * Returns the list of indices
330 public static function indices($localize = TRUE) {
332 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;