5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Mailing/MailingJob.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:51449e1b36d9d248712f346f20c9e446)
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 static $_tableName = 'civicrm_mailing_job';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 foreign keys and entity references.
118 * [CRM_Core_Reference_Interface]
120 public static function getReferenceColumns() {
121 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
122 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
123 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'mailing_id', 'civicrm_mailing', 'id');
124 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'parent_id', 'civicrm_mailing_job', 'id');
125 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
127 return Civi
::$statics[__CLASS__
]['links'];
131 * Returns all the column names of this table
135 public static function &fields() {
136 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
137 Civi
::$statics[__CLASS__
]['fields'] = [
140 'type' => CRM_Utils_Type
::T_INT
,
141 'title' => ts('Mailing Job ID'),
143 'table_name' => 'civicrm_mailing_job',
144 'entity' => 'MailingJob',
145 'bao' => 'CRM_Mailing_BAO_MailingJob',
149 'name' => 'mailing_id',
150 'type' => CRM_Utils_Type
::T_INT
,
151 'title' => ts('Mailing'),
152 'description' => ts('The ID of the mailing this Job will send.'),
154 'table_name' => 'civicrm_mailing_job',
155 'entity' => 'MailingJob',
156 'bao' => 'CRM_Mailing_BAO_MailingJob',
158 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
160 'scheduled_date' => [
161 'name' => 'scheduled_date',
162 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
163 'title' => ts('Mailing Scheduled Date'),
164 'description' => ts('date on which this job was scheduled.'),
167 'table_name' => 'civicrm_mailing_job',
168 'entity' => 'MailingJob',
169 'bao' => 'CRM_Mailing_BAO_MailingJob',
173 'name' => 'start_date',
174 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
175 'title' => ts('Mailing Job Start Date'),
176 'description' => ts('date on which this job was started.'),
179 'table_name' => 'civicrm_mailing_job',
180 'entity' => 'MailingJob',
181 'bao' => 'CRM_Mailing_BAO_MailingJob',
185 'name' => 'end_date',
186 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
187 'title' => ts('Mailing Job End Date'),
188 'description' => ts('date on which this job ended.'),
191 'table_name' => 'civicrm_mailing_job',
192 'entity' => 'MailingJob',
193 'bao' => 'CRM_Mailing_BAO_MailingJob',
198 'type' => CRM_Utils_Type
::T_STRING
,
199 'title' => ts('Mailing Job Status'),
200 'description' => ts('The state of this job'),
202 'size' => CRM_Utils_Type
::TWELVE
,
203 'table_name' => 'civicrm_mailing_job',
204 'entity' => 'MailingJob',
205 'bao' => 'CRM_Mailing_BAO_MailingJob',
210 'pseudoconstant' => [
211 'callback' => 'CRM_Core_SelectValues::getMailingJobStatus',
216 'type' => CRM_Utils_Type
::T_BOOLEAN
,
217 'title' => ts('Mailing Job Is Test?'),
218 'description' => ts('Is this job for a test mail?'),
220 'table_name' => 'civicrm_mailing_job',
221 'entity' => 'MailingJob',
222 'bao' => 'CRM_Mailing_BAO_MailingJob',
226 'name' => 'job_type',
227 'type' => CRM_Utils_Type
::T_STRING
,
228 'title' => ts('Mailing Job Type'),
229 'description' => ts('Type of mailling job: null | child '),
231 'size' => CRM_Utils_Type
::HUGE
,
232 'table_name' => 'civicrm_mailing_job',
233 'entity' => 'MailingJob',
234 'bao' => 'CRM_Mailing_BAO_MailingJob',
238 'name' => 'parent_id',
239 'type' => CRM_Utils_Type
::T_INT
,
240 'title' => ts('Mailing Job Parent'),
241 'description' => ts('Parent job id'),
243 'table_name' => 'civicrm_mailing_job',
244 'entity' => 'MailingJob',
245 'bao' => 'CRM_Mailing_BAO_MailingJob',
247 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
250 'name' => 'job_offset',
251 'type' => CRM_Utils_Type
::T_INT
,
252 'title' => ts('Mailing Job Offset'),
253 'description' => ts('Offset of the child job'),
255 'table_name' => 'civicrm_mailing_job',
256 'entity' => 'MailingJob',
257 'bao' => 'CRM_Mailing_BAO_MailingJob',
261 'name' => 'job_limit',
262 'type' => CRM_Utils_Type
::T_INT
,
263 'title' => ts('Mailing Job Limit'),
264 'description' => ts('Queue size limit for each child job'),
266 'table_name' => 'civicrm_mailing_job',
267 'entity' => 'MailingJob',
268 'bao' => 'CRM_Mailing_BAO_MailingJob',
272 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
274 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 public 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'];
291 * Returns the names of this table
295 public static function getTableName() {
296 return self
::$_tableName;
300 * Returns if this table needs to be logged
304 public function getLog() {
309 * Returns the list of fields that can be imported
311 * @param bool $prefix
315 public static function &import($prefix = FALSE) {
316 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_job', $prefix, []);
321 * Returns the list of fields that can be exported
323 * @param bool $prefix
327 public static function &export($prefix = FALSE) {
328 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_job', $prefix, []);
333 * Returns the list of indices
335 * @param bool $localize
339 public static function indices($localize = TRUE) {
341 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;