Regen DAOs with new import() / export()
[civicrm-core.git] / CRM / Mailing / DAO / MailingJob.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2016
30 *
31 * Generated from xml/schema/CRM/Mailing/MailingJob.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:df7f5d74b6be9d995c7990e4315bfe40)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Mailing_DAO_MailingJob extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_mailing_job';
44 /**
45 * static instance to hold the field values
46 *
47 * @var array
48 */
49 static $_fields = null;
50 /**
51 * static instance to hold the keys used in $_fields for each field.
52 *
53 * @var array
54 */
55 static $_fieldKeys = null;
56 /**
57 * static instance to hold the FK relationships
58 *
59 * @var string
60 */
61 static $_links = null;
62 /**
63 * static value to see if we should log any modifications to
64 * this table in the civicrm_log table
65 *
66 * @var boolean
67 */
68 static $_log = false;
69 /**
70 *
71 * @var int unsigned
72 */
73 public $id;
74 /**
75 * The ID of the mailing this Job will send.
76 *
77 * @var int unsigned
78 */
79 public $mailing_id;
80 /**
81 * date on which this job was scheduled.
82 *
83 * @var datetime
84 */
85 public $scheduled_date;
86 /**
87 * date on which this job was started.
88 *
89 * @var datetime
90 */
91 public $start_date;
92 /**
93 * date on which this job ended.
94 *
95 * @var datetime
96 */
97 public $end_date;
98 /**
99 * The state of this job
100 *
101 * @var string
102 */
103 public $status;
104 /**
105 * Is this job for a test mail?
106 *
107 * @var boolean
108 */
109 public $is_test;
110 /**
111 * Type of mailling job: null | child
112 *
113 * @var string
114 */
115 public $job_type;
116 /**
117 * Parent job id
118 *
119 * @var int unsigned
120 */
121 public $parent_id;
122 /**
123 * Offset of the child job
124 *
125 * @var int
126 */
127 public $job_offset;
128 /**
129 * Queue size limit for each child job
130 *
131 * @var int
132 */
133 public $job_limit;
134 /**
135 * class constructor
136 *
137 * @return civicrm_mailing_job
138 */
139 function __construct() {
140 $this->__table = 'civicrm_mailing_job';
141 parent::__construct();
142 }
143 /**
144 * Returns foreign keys and entity references
145 *
146 * @return array
147 * [CRM_Core_Reference_Interface]
148 */
149 static function getReferenceColumns() {
150 if (!self::$_links) {
151 self::$_links = static ::createReferenceColumns(__CLASS__);
152 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'mailing_id', 'civicrm_mailing', 'id');
153 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'parent_id', 'civicrm_mailing_job', 'id');
154 }
155 return self::$_links;
156 }
157 /**
158 * Returns all the column names of this table
159 *
160 * @return array
161 */
162 static function &fields() {
163 if (!(self::$_fields)) {
164 self::$_fields = array(
165 'id' => array(
166 'name' => 'id',
167 'type' => CRM_Utils_Type::T_INT,
168 'title' => ts('Mailing Job ID') ,
169 'required' => true,
170 ) ,
171 'mailing_id' => array(
172 'name' => 'mailing_id',
173 'type' => CRM_Utils_Type::T_INT,
174 'title' => ts('Mailing') ,
175 'description' => 'The ID of the mailing this Job will send.',
176 'required' => true,
177 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
178 ) ,
179 'scheduled_date' => array(
180 'name' => 'scheduled_date',
181 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
182 'title' => ts('Mailing Scheduled Date') ,
183 'description' => 'date on which this job was scheduled.',
184 ) ,
185 'start_date' => array(
186 'name' => 'start_date',
187 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
188 'title' => ts('Mailing Job Start Date') ,
189 'description' => 'date on which this job was started.',
190 ) ,
191 'end_date' => array(
192 'name' => 'end_date',
193 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
194 'title' => ts('Mailing Job End Date') ,
195 'description' => 'date on which this job ended.',
196 ) ,
197 'status' => array(
198 'name' => 'status',
199 'type' => CRM_Utils_Type::T_STRING,
200 'title' => ts('Mailing Job Status') ,
201 'description' => 'The state of this job',
202 'maxlength' => 12,
203 'size' => CRM_Utils_Type::TWELVE,
204 'html' => array(
205 'type' => 'Select',
206 ) ,
207 'pseudoconstant' => array(
208 'callback' => 'CRM_Core_SelectValues::getMailingJobStatus',
209 )
210 ) ,
211 'is_test' => array(
212 'name' => 'is_test',
213 'type' => CRM_Utils_Type::T_BOOLEAN,
214 'title' => ts('Mailing Job Is Test?') ,
215 'description' => 'Is this job for a test mail?',
216 ) ,
217 'job_type' => array(
218 'name' => 'job_type',
219 'type' => CRM_Utils_Type::T_STRING,
220 'title' => ts('Mailing Job Type') ,
221 'description' => 'Type of mailling job: null | child ',
222 'maxlength' => 255,
223 'size' => CRM_Utils_Type::HUGE,
224 ) ,
225 'parent_id' => array(
226 'name' => 'parent_id',
227 'type' => CRM_Utils_Type::T_INT,
228 'title' => ts('Mailing Job Parent') ,
229 'description' => 'Parent job id',
230 'default' => 'NULL',
231 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
232 ) ,
233 'job_offset' => array(
234 'name' => 'job_offset',
235 'type' => CRM_Utils_Type::T_INT,
236 'title' => ts('Mailing Job Offset') ,
237 'description' => 'Offset of the child job',
238 ) ,
239 'job_limit' => array(
240 'name' => 'job_limit',
241 'type' => CRM_Utils_Type::T_INT,
242 'title' => ts('Mailing Job Limit') ,
243 'description' => 'Queue size limit for each child job',
244 ) ,
245 );
246 }
247 return self::$_fields;
248 }
249 /**
250 * Returns an array containing, for each field, the arary key used for that
251 * field in self::$_fields.
252 *
253 * @return array
254 */
255 static function &fieldKeys() {
256 if (!(self::$_fieldKeys)) {
257 self::$_fieldKeys = array(
258 'id' => 'id',
259 'mailing_id' => 'mailing_id',
260 'scheduled_date' => 'scheduled_date',
261 'start_date' => 'start_date',
262 'end_date' => 'end_date',
263 'status' => 'status',
264 'is_test' => 'is_test',
265 'job_type' => 'job_type',
266 'parent_id' => 'parent_id',
267 'job_offset' => 'job_offset',
268 'job_limit' => 'job_limit',
269 );
270 }
271 return self::$_fieldKeys;
272 }
273 /**
274 * Returns the names of this table
275 *
276 * @return string
277 */
278 static function getTableName() {
279 return self::$_tableName;
280 }
281 /**
282 * Returns if this table needs to be logged
283 *
284 * @return boolean
285 */
286 function getLog() {
287 return self::$_log;
288 }
289 /**
290 * Returns the list of fields that can be imported
291 *
292 * @param bool $prefix
293 *
294 * @return array
295 */
296 static function &import($prefix = false) {
297 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_job', $prefix, array());
298 return $r;
299 }
300 /**
301 * Returns the list of fields that can be exported
302 *
303 * @param bool $prefix
304 *
305 * @return array
306 */
307 static function &export($prefix = false) {
308 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_job', $prefix, array());
309 return $r;
310 }
311 }