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:6f300d432494c6b7df0480c1768290c8)
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',
157 'name' => 'mailing_id',
158 'type' => CRM_Utils_Type
::T_INT
,
159 'title' => ts('Mailing'),
160 'description' => ts('The ID of the mailing this Job will send.'),
162 'where' => 'civicrm_mailing_job.mailing_id',
163 'table_name' => 'civicrm_mailing_job',
164 'entity' => 'MailingJob',
165 'bao' => 'CRM_Mailing_BAO_MailingJob',
167 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
169 'scheduled_date' => [
170 'name' => 'scheduled_date',
171 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
172 'title' => ts('Mailing Scheduled Date'),
173 'description' => ts('date on which this job was scheduled.'),
175 'where' => 'civicrm_mailing_job.scheduled_date',
177 'table_name' => 'civicrm_mailing_job',
178 'entity' => 'MailingJob',
179 'bao' => 'CRM_Mailing_BAO_MailingJob',
182 'type' => 'Select Date',
183 'formatType' => 'activityDateTime',
186 'mailing_job_start_date' => [
187 'name' => 'start_date',
188 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
189 'title' => ts('Mailing Job Start Date'),
190 'description' => ts('date on which this job was started.'),
192 'where' => 'civicrm_mailing_job.start_date',
194 'table_name' => 'civicrm_mailing_job',
195 'entity' => 'MailingJob',
196 'bao' => 'CRM_Mailing_BAO_MailingJob',
198 'unique_title' => ts('Mailing Start Date'),
200 'type' => 'Select Date',
201 'formatType' => 'activityDateTime',
205 'name' => 'end_date',
206 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
207 'title' => ts('Mailing Job End Date'),
208 'description' => ts('date on which this job ended.'),
210 'where' => 'civicrm_mailing_job.end_date',
212 'table_name' => 'civicrm_mailing_job',
213 'entity' => 'MailingJob',
214 'bao' => 'CRM_Mailing_BAO_MailingJob',
217 'type' => 'Select Date',
218 'formatType' => 'activityDateTime',
221 'mailing_job_status' => [
223 'type' => CRM_Utils_Type
::T_STRING
,
224 'title' => ts('Mailing Job Status'),
225 'description' => ts('The state of this job'),
227 'size' => CRM_Utils_Type
::TWELVE
,
228 'where' => 'civicrm_mailing_job.status',
229 'table_name' => 'civicrm_mailing_job',
230 'entity' => 'MailingJob',
231 'bao' => 'CRM_Mailing_BAO_MailingJob',
236 'pseudoconstant' => [
237 'callback' => 'CRM_Core_SelectValues::getMailingJobStatus',
242 'type' => CRM_Utils_Type
::T_BOOLEAN
,
243 'title' => ts('Mailing Job Is Test?'),
244 'description' => ts('Is this job for a test mail?'),
245 'where' => 'civicrm_mailing_job.is_test',
247 'table_name' => 'civicrm_mailing_job',
248 'entity' => 'MailingJob',
249 'bao' => 'CRM_Mailing_BAO_MailingJob',
253 'name' => 'job_type',
254 'type' => CRM_Utils_Type
::T_STRING
,
255 'title' => ts('Mailing Job Type'),
256 'description' => ts('Type of mailling job: null | child '),
258 'size' => CRM_Utils_Type
::HUGE
,
259 'where' => 'civicrm_mailing_job.job_type',
260 'table_name' => 'civicrm_mailing_job',
261 'entity' => 'MailingJob',
262 'bao' => 'CRM_Mailing_BAO_MailingJob',
266 'name' => 'parent_id',
267 'type' => CRM_Utils_Type
::T_INT
,
268 'title' => ts('Mailing Job Parent'),
269 'description' => ts('Parent job id'),
270 'where' => 'civicrm_mailing_job.parent_id',
272 'table_name' => 'civicrm_mailing_job',
273 'entity' => 'MailingJob',
274 'bao' => 'CRM_Mailing_BAO_MailingJob',
276 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
279 'name' => 'job_offset',
280 'type' => CRM_Utils_Type
::T_INT
,
281 'title' => ts('Mailing Job Offset'),
282 'description' => ts('Offset of the child job'),
283 'where' => 'civicrm_mailing_job.job_offset',
285 'table_name' => 'civicrm_mailing_job',
286 'entity' => 'MailingJob',
287 'bao' => 'CRM_Mailing_BAO_MailingJob',
291 'name' => 'job_limit',
292 'type' => CRM_Utils_Type
::T_INT
,
293 'title' => ts('Mailing Job Limit'),
294 'description' => ts('Queue size limit for each child job'),
295 'where' => 'civicrm_mailing_job.job_limit',
297 'table_name' => 'civicrm_mailing_job',
298 'entity' => 'MailingJob',
299 'bao' => 'CRM_Mailing_BAO_MailingJob',
303 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
305 return Civi
::$statics[__CLASS__
]['fields'];
309 * Return a mapping from field-name to the corresponding key (as used in fields()).
312 * Array(string $name => string $uniqueName).
314 public static function &fieldKeys() {
315 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
316 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
318 return Civi
::$statics[__CLASS__
]['fieldKeys'];
322 * Returns the names of this table
326 public static function getTableName() {
327 return self
::$_tableName;
331 * Returns if this table needs to be logged
335 public function getLog() {
340 * Returns the list of fields that can be imported
342 * @param bool $prefix
346 public static function &import($prefix = FALSE) {
347 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_job', $prefix, []);
352 * Returns the list of fields that can be exported
354 * @param bool $prefix
358 public static function &export($prefix = FALSE) {
359 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_job', $prefix, []);
364 * Returns the list of indices
366 * @param bool $localize
370 public static function indices($localize = TRUE) {
372 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;