Regen DAOs with new fieldKeys()
[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 FK relationships
52 *
53 * @var string
54 */
55 static $_links = null;
56 /**
57 * static value to see if we should log any modifications to
58 * this table in the civicrm_log table
59 *
60 * @var boolean
61 */
62 static $_log = false;
63 /**
64 *
65 * @var int unsigned
66 */
67 public $id;
68 /**
69 * The ID of the mailing this Job will send.
70 *
71 * @var int unsigned
72 */
73 public $mailing_id;
74 /**
75 * date on which this job was scheduled.
76 *
77 * @var datetime
78 */
79 public $scheduled_date;
80 /**
81 * date on which this job was started.
82 *
83 * @var datetime
84 */
85 public $start_date;
86 /**
87 * date on which this job ended.
88 *
89 * @var datetime
90 */
91 public $end_date;
92 /**
93 * The state of this job
94 *
95 * @var string
96 */
97 public $status;
98 /**
99 * Is this job for a test mail?
100 *
101 * @var boolean
102 */
103 public $is_test;
104 /**
105 * Type of mailling job: null | child
106 *
107 * @var string
108 */
109 public $job_type;
110 /**
111 * Parent job id
112 *
113 * @var int unsigned
114 */
115 public $parent_id;
116 /**
117 * Offset of the child job
118 *
119 * @var int
120 */
121 public $job_offset;
122 /**
123 * Queue size limit for each child job
124 *
125 * @var int
126 */
127 public $job_limit;
128 /**
129 * class constructor
130 *
131 * @return civicrm_mailing_job
132 */
133 function __construct() {
134 $this->__table = 'civicrm_mailing_job';
135 parent::__construct();
136 }
137 /**
138 * Returns foreign keys and entity references
139 *
140 * @return array
141 * [CRM_Core_Reference_Interface]
142 */
143 static function getReferenceColumns() {
144 if (!self::$_links) {
145 self::$_links = static ::createReferenceColumns(__CLASS__);
146 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'mailing_id', 'civicrm_mailing', 'id');
147 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'parent_id', 'civicrm_mailing_job', 'id');
148 }
149 return self::$_links;
150 }
151 /**
152 * Returns all the column names of this table
153 *
154 * @return array
155 */
156 static function &fields() {
157 if (!(self::$_fields)) {
158 self::$_fields = array(
159 'id' => array(
160 'name' => 'id',
161 'type' => CRM_Utils_Type::T_INT,
162 'title' => ts('Mailing Job ID') ,
163 'required' => true,
164 ) ,
165 'mailing_id' => array(
166 'name' => 'mailing_id',
167 'type' => CRM_Utils_Type::T_INT,
168 'title' => ts('Mailing') ,
169 'description' => 'The ID of the mailing this Job will send.',
170 'required' => true,
171 'FKClassName' => 'CRM_Mailing_DAO_Mailing',
172 ) ,
173 'scheduled_date' => array(
174 'name' => 'scheduled_date',
175 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
176 'title' => ts('Mailing Scheduled Date') ,
177 'description' => 'date on which this job was scheduled.',
178 ) ,
179 'start_date' => array(
180 'name' => 'start_date',
181 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
182 'title' => ts('Mailing Job Start Date') ,
183 'description' => 'date on which this job was started.',
184 ) ,
185 'end_date' => array(
186 'name' => 'end_date',
187 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
188 'title' => ts('Mailing Job End Date') ,
189 'description' => 'date on which this job ended.',
190 ) ,
191 'status' => array(
192 'name' => 'status',
193 'type' => CRM_Utils_Type::T_STRING,
194 'title' => ts('Mailing Job Status') ,
195 'description' => 'The state of this job',
196 'maxlength' => 12,
197 'size' => CRM_Utils_Type::TWELVE,
198 'html' => array(
199 'type' => 'Select',
200 ) ,
201 'pseudoconstant' => array(
202 'callback' => 'CRM_Core_SelectValues::getMailingJobStatus',
203 )
204 ) ,
205 'is_test' => array(
206 'name' => 'is_test',
207 'type' => CRM_Utils_Type::T_BOOLEAN,
208 'title' => ts('Mailing Job Is Test?') ,
209 'description' => 'Is this job for a test mail?',
210 ) ,
211 'job_type' => array(
212 'name' => 'job_type',
213 'type' => CRM_Utils_Type::T_STRING,
214 'title' => ts('Mailing Job Type') ,
215 'description' => 'Type of mailling job: null | child ',
216 'maxlength' => 255,
217 'size' => CRM_Utils_Type::HUGE,
218 ) ,
219 'parent_id' => array(
220 'name' => 'parent_id',
221 'type' => CRM_Utils_Type::T_INT,
222 'title' => ts('Mailing Job Parent') ,
223 'description' => 'Parent job id',
224 'default' => 'NULL',
225 'FKClassName' => 'CRM_Mailing_DAO_MailingJob',
226 ) ,
227 'job_offset' => array(
228 'name' => 'job_offset',
229 'type' => CRM_Utils_Type::T_INT,
230 'title' => ts('Mailing Job Offset') ,
231 'description' => 'Offset of the child job',
232 ) ,
233 'job_limit' => array(
234 'name' => 'job_limit',
235 'type' => CRM_Utils_Type::T_INT,
236 'title' => ts('Mailing Job Limit') ,
237 'description' => 'Queue size limit for each child job',
238 ) ,
239 );
240 }
241 return self::$_fields;
242 }
243 /**
244 * Return a mapping from field-name to the corresponding key (as used in fields()).
245 *
246 * @return array
247 * Array(string $name => string $uniqueName).
248 */
249 static function &fieldKeys() {
250 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
251 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
252 }
253 return Civi::$statics[__CLASS__]['fieldKeys'];
254 }
255 /**
256 * Returns the names of this table
257 *
258 * @return string
259 */
260 static function getTableName() {
261 return self::$_tableName;
262 }
263 /**
264 * Returns if this table needs to be logged
265 *
266 * @return boolean
267 */
268 function getLog() {
269 return self::$_log;
270 }
271 /**
272 * Returns the list of fields that can be imported
273 *
274 * @param bool $prefix
275 *
276 * @return array
277 */
278 static function &import($prefix = false) {
279 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_job', $prefix, array());
280 return $r;
281 }
282 /**
283 * Returns the list of fields that can be exported
284 *
285 * @param bool $prefix
286 *
287 * @return array
288 */
289 static function &export($prefix = false) {
290 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_job', $prefix, array());
291 return $r;
292 }
293 }