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:91fa15df43a9b86ba6cd53f1cc9783eb)
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 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 'where' => 'civicrm_mailing_job.id',
144 'table_name' => 'civicrm_mailing_job',
145 'entity' => 'MailingJob',
146 'bao' => 'CRM_Mailing_BAO_MailingJob',
150 'name' => 'mailing_id',
151 'type' => CRM_Utils_Type
::T_INT
,
152 'title' => ts('Mailing'),
153 'description' => ts('The ID of the mailing this Job will send.'),
155 'where' => 'civicrm_mailing_job.mailing_id',
156 'table_name' => 'civicrm_mailing_job',
157 'entity' => 'MailingJob',
158 'bao' => 'CRM_Mailing_BAO_MailingJob',
160 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
162 'scheduled_date' => [
163 'name' => 'scheduled_date',
164 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
165 'title' => ts('Mailing Scheduled Date'),
166 'description' => ts('date on which this job was scheduled.'),
168 'where' => 'civicrm_mailing_job.scheduled_date',
170 'table_name' => 'civicrm_mailing_job',
171 'entity' => 'MailingJob',
172 'bao' => 'CRM_Mailing_BAO_MailingJob',
175 'type' => 'Select Date',
176 'formatType' => 'activityDateTime',
179 'mailing_job_start_date' => [
180 'name' => 'start_date',
181 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
182 'title' => ts('Mailing Job Start Date'),
183 'description' => ts('date on which this job was started.'),
185 'where' => 'civicrm_mailing_job.start_date',
187 'table_name' => 'civicrm_mailing_job',
188 'entity' => 'MailingJob',
189 'bao' => 'CRM_Mailing_BAO_MailingJob',
191 'unique_title' => ts('Mailing Start Date'),
193 'type' => 'Select Date',
194 'formatType' => 'activityDateTime',
198 'name' => 'end_date',
199 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
200 'title' => ts('Mailing Job End Date'),
201 'description' => ts('date on which this job ended.'),
203 'where' => 'civicrm_mailing_job.end_date',
205 'table_name' => 'civicrm_mailing_job',
206 'entity' => 'MailingJob',
207 'bao' => 'CRM_Mailing_BAO_MailingJob',
210 'type' => 'Select Date',
211 'formatType' => 'activityDateTime',
214 'mailing_job_status' => [
216 'type' => CRM_Utils_Type
::T_STRING
,
217 'title' => ts('Mailing Job Status'),
218 'description' => ts('The state of this job'),
220 'size' => CRM_Utils_Type
::TWELVE
,
221 'where' => 'civicrm_mailing_job.status',
222 'table_name' => 'civicrm_mailing_job',
223 'entity' => 'MailingJob',
224 'bao' => 'CRM_Mailing_BAO_MailingJob',
229 'pseudoconstant' => [
230 'callback' => 'CRM_Core_SelectValues::getMailingJobStatus',
235 'type' => CRM_Utils_Type
::T_BOOLEAN
,
236 'title' => ts('Mailing Job Is Test?'),
237 'description' => ts('Is this job for a test mail?'),
238 'where' => 'civicrm_mailing_job.is_test',
240 'table_name' => 'civicrm_mailing_job',
241 'entity' => 'MailingJob',
242 'bao' => 'CRM_Mailing_BAO_MailingJob',
246 'name' => 'job_type',
247 'type' => CRM_Utils_Type
::T_STRING
,
248 'title' => ts('Mailing Job Type'),
249 'description' => ts('Type of mailling job: null | child '),
251 'size' => CRM_Utils_Type
::HUGE
,
252 'where' => 'civicrm_mailing_job.job_type',
253 'table_name' => 'civicrm_mailing_job',
254 'entity' => 'MailingJob',
255 'bao' => 'CRM_Mailing_BAO_MailingJob',
259 'name' => 'parent_id',
260 'type' => CRM_Utils_Type
::T_INT
,
261 'title' => ts('Mailing Job Parent'),
262 'description' => ts('Parent job id'),
263 'where' => 'civicrm_mailing_job.parent_id',
265 'table_name' => 'civicrm_mailing_job',
266 'entity' => 'MailingJob',
267 'bao' => 'CRM_Mailing_BAO_MailingJob',
269 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
272 'name' => 'job_offset',
273 'type' => CRM_Utils_Type
::T_INT
,
274 'title' => ts('Mailing Job Offset'),
275 'description' => ts('Offset of the child job'),
276 'where' => 'civicrm_mailing_job.job_offset',
278 'table_name' => 'civicrm_mailing_job',
279 'entity' => 'MailingJob',
280 'bao' => 'CRM_Mailing_BAO_MailingJob',
284 'name' => 'job_limit',
285 'type' => CRM_Utils_Type
::T_INT
,
286 'title' => ts('Mailing Job Limit'),
287 'description' => ts('Queue size limit for each child job'),
288 'where' => 'civicrm_mailing_job.job_limit',
290 'table_name' => 'civicrm_mailing_job',
291 'entity' => 'MailingJob',
292 'bao' => 'CRM_Mailing_BAO_MailingJob',
296 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
298 return Civi
::$statics[__CLASS__
]['fields'];
302 * Return a mapping from field-name to the corresponding key (as used in fields()).
305 * Array(string $name => string $uniqueName).
307 public static function &fieldKeys() {
308 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
309 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
311 return Civi
::$statics[__CLASS__
]['fieldKeys'];
315 * Returns the names of this table
319 public static function getTableName() {
320 return self
::$_tableName;
324 * Returns if this table needs to be logged
328 public function getLog() {
333 * Returns the list of fields that can be imported
335 * @param bool $prefix
339 public static function &import($prefix = FALSE) {
340 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_job', $prefix, []);
345 * Returns the list of fields that can be exported
347 * @param bool $prefix
351 public static function &export($prefix = FALSE) {
352 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_job', $prefix, []);
357 * Returns the list of indices
359 * @param bool $localize
363 public static function indices($localize = TRUE) {
365 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;