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