5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/MailingJob.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:b84e3c6e86ddabfe04066d742f5c0ca5)
13 * Database access object for the MailingJob entity.
15 class CRM_Mailing_DAO_MailingJob
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_mailing_job';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
37 * The ID of the mailing this Job will send.
44 * date on which this job was scheduled.
48 public $scheduled_date;
51 * date on which this job was started.
58 * date on which this job ended.
65 * The state of this job
72 * Is this job for a test mail?
79 * Type of mailling job: null | child
93 * Offset of the child job
100 * Queue size limit for each child job
109 public function __construct() {
110 $this->__table
= 'civicrm_mailing_job';
111 parent
::__construct();
115 * Returns localized title of this entity.
117 public static function getEntityTitle() {
118 return ts('Mailing Jobs');
122 * Returns foreign keys and entity references.
125 * [CRM_Core_Reference_Interface]
127 public static function getReferenceColumns() {
128 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
129 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
130 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'mailing_id', 'civicrm_mailing', 'id');
131 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'parent_id', 'civicrm_mailing_job', 'id');
132 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
134 return Civi
::$statics[__CLASS__
]['links'];
138 * Returns all the column names of this table
142 public static function &fields() {
143 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
144 Civi
::$statics[__CLASS__
]['fields'] = [
147 'type' => CRM_Utils_Type
::T_INT
,
148 'title' => ts('Mailing Job ID'),
150 'where' => 'civicrm_mailing_job.id',
151 'table_name' => 'civicrm_mailing_job',
152 'entity' => 'MailingJob',
153 'bao' => 'CRM_Mailing_BAO_MailingJob',
158 'name' => 'mailing_id',
159 'type' => CRM_Utils_Type
::T_INT
,
160 'title' => ts('Mailing'),
161 'description' => ts('The ID of the mailing this Job will send.'),
163 'where' => 'civicrm_mailing_job.mailing_id',
164 'table_name' => 'civicrm_mailing_job',
165 'entity' => 'MailingJob',
166 'bao' => 'CRM_Mailing_BAO_MailingJob',
168 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
171 'scheduled_date' => [
172 'name' => 'scheduled_date',
173 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
174 'title' => ts('Mailing Scheduled Date'),
175 'description' => ts('date on which this job was scheduled.'),
177 'where' => 'civicrm_mailing_job.scheduled_date',
179 'table_name' => 'civicrm_mailing_job',
180 'entity' => 'MailingJob',
181 'bao' => 'CRM_Mailing_BAO_MailingJob',
184 'type' => 'Select Date',
185 'formatType' => 'activityDateTime',
189 'mailing_job_start_date' => [
190 'name' => 'start_date',
191 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
192 'title' => ts('Mailing Job Start Date'),
193 'description' => ts('date on which this job was started.'),
195 'where' => 'civicrm_mailing_job.start_date',
197 'table_name' => 'civicrm_mailing_job',
198 'entity' => 'MailingJob',
199 'bao' => 'CRM_Mailing_BAO_MailingJob',
201 'unique_title' => ts('Mailing Start Date'),
203 'type' => 'Select Date',
204 'formatType' => 'activityDateTime',
209 'name' => 'end_date',
210 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
211 'title' => ts('Mailing Job End Date'),
212 'description' => ts('date on which this job ended.'),
214 'where' => 'civicrm_mailing_job.end_date',
216 'table_name' => 'civicrm_mailing_job',
217 'entity' => 'MailingJob',
218 'bao' => 'CRM_Mailing_BAO_MailingJob',
221 'type' => 'Select Date',
222 'formatType' => 'activityDateTime',
226 'mailing_job_status' => [
228 'type' => CRM_Utils_Type
::T_STRING
,
229 'title' => ts('Mailing Job Status'),
230 'description' => ts('The state of this job'),
232 'size' => CRM_Utils_Type
::TWELVE
,
233 'where' => 'civicrm_mailing_job.status',
234 'table_name' => 'civicrm_mailing_job',
235 'entity' => 'MailingJob',
236 'bao' => 'CRM_Mailing_BAO_MailingJob',
241 'pseudoconstant' => [
242 'callback' => 'CRM_Core_SelectValues::getMailingJobStatus',
248 'type' => CRM_Utils_Type
::T_BOOLEAN
,
249 'title' => ts('Mailing Job Is Test?'),
250 'description' => ts('Is this job for a test mail?'),
251 'where' => 'civicrm_mailing_job.is_test',
253 'table_name' => 'civicrm_mailing_job',
254 'entity' => 'MailingJob',
255 'bao' => 'CRM_Mailing_BAO_MailingJob',
260 'name' => 'job_type',
261 'type' => CRM_Utils_Type
::T_STRING
,
262 'title' => ts('Mailing Job Type'),
263 'description' => ts('Type of mailling job: null | child '),
265 'size' => CRM_Utils_Type
::HUGE
,
266 'where' => 'civicrm_mailing_job.job_type',
267 'table_name' => 'civicrm_mailing_job',
268 'entity' => 'MailingJob',
269 'bao' => 'CRM_Mailing_BAO_MailingJob',
274 'name' => 'parent_id',
275 'type' => CRM_Utils_Type
::T_INT
,
276 'title' => ts('Mailing Job Parent'),
277 'description' => ts('Parent job id'),
278 'where' => 'civicrm_mailing_job.parent_id',
280 'table_name' => 'civicrm_mailing_job',
281 'entity' => 'MailingJob',
282 'bao' => 'CRM_Mailing_BAO_MailingJob',
284 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
288 'name' => 'job_offset',
289 'type' => CRM_Utils_Type
::T_INT
,
290 'title' => ts('Mailing Job Offset'),
291 'description' => ts('Offset of the child job'),
292 'where' => 'civicrm_mailing_job.job_offset',
294 'table_name' => 'civicrm_mailing_job',
295 'entity' => 'MailingJob',
296 'bao' => 'CRM_Mailing_BAO_MailingJob',
301 'name' => 'job_limit',
302 'type' => CRM_Utils_Type
::T_INT
,
303 'title' => ts('Mailing Job Limit'),
304 'description' => ts('Queue size limit for each child job'),
305 'where' => 'civicrm_mailing_job.job_limit',
307 'table_name' => 'civicrm_mailing_job',
308 'entity' => 'MailingJob',
309 'bao' => 'CRM_Mailing_BAO_MailingJob',
314 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
316 return Civi
::$statics[__CLASS__
]['fields'];
320 * Return a mapping from field-name to the corresponding key (as used in fields()).
323 * Array(string $name => string $uniqueName).
325 public static function &fieldKeys() {
326 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
327 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
329 return Civi
::$statics[__CLASS__
]['fieldKeys'];
333 * Returns the names of this table
337 public static function getTableName() {
338 return self
::$_tableName;
342 * Returns if this table needs to be logged
346 public function getLog() {
351 * Returns the list of fields that can be imported
353 * @param bool $prefix
357 public static function &import($prefix = FALSE) {
358 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_job', $prefix, []);
363 * Returns the list of fields that can be exported
365 * @param bool $prefix
369 public static function &export($prefix = FALSE) {
370 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_job', $prefix, []);
375 * Returns the list of indices
377 * @param bool $localize
381 public static function indices($localize = TRUE) {
383 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;