fixup CRM-14885 - Import DAOs
[civicrm-core.git] / CRM / Queue / DAO / QueueItem.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/Queue/QueueItem.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:45218486c40b902ee5e043e22b1a7d20)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Queue_DAO_QueueItem extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_queue_item';
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 instance to hold the values that can
64 * be imported
65 *
66 * @var array
67 */
68 static $_import = null;
69 /**
70 * static instance to hold the values that can
71 * be exported
72 *
73 * @var array
74 */
75 static $_export = null;
76 /**
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
79 *
80 * @var boolean
81 */
82 static $_log = false;
83 /**
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * Name of the queue which includes this item
90 *
91 * @var string
92 */
93 public $queue_name;
94 /**
95 *
96 * @var int
97 */
98 public $weight;
99 /**
100 * date on which this item was submitted to the queue
101 *
102 * @var datetime
103 */
104 public $submit_time;
105 /**
106 * date on which this job becomes available; null if ASAP
107 *
108 * @var datetime
109 */
110 public $release_time;
111 /**
112 * Serialized queue
113 *
114 * @var text
115 */
116 public $data;
117 /**
118 * class constructor
119 *
120 * @return civicrm_queue_item
121 */
122 function __construct() {
123 $this->__table = 'civicrm_queue_item';
124 parent::__construct();
125 }
126 /**
127 * Returns all the column names of this table
128 *
129 * @return array
130 */
131 static function &fields() {
132 if (!(self::$_fields)) {
133 self::$_fields = array(
134 'id' => array(
135 'name' => 'id',
136 'type' => CRM_Utils_Type::T_INT,
137 'title' => ts('Queue ID') ,
138 'required' => true,
139 ) ,
140 'queue_name' => array(
141 'name' => 'queue_name',
142 'type' => CRM_Utils_Type::T_STRING,
143 'title' => ts('Queue Name') ,
144 'description' => 'Name of the queue which includes this item',
145 'required' => true,
146 'maxlength' => 64,
147 'size' => CRM_Utils_Type::BIG,
148 'html' => array(
149 'type' => 'Text',
150 ) ,
151 ) ,
152 'weight' => array(
153 'name' => 'weight',
154 'type' => CRM_Utils_Type::T_INT,
155 'title' => ts('Order') ,
156 'required' => true,
157 'html' => array(
158 'type' => 'Text',
159 ) ,
160 ) ,
161 'submit_time' => array(
162 'name' => 'submit_time',
163 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
164 'title' => ts('Submit Time') ,
165 'description' => 'date on which this item was submitted to the queue',
166 'required' => true,
167 'html' => array(
168 'type' => 'Select Date',
169 ) ,
170 ) ,
171 'release_time' => array(
172 'name' => 'release_time',
173 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
174 'title' => ts('Release Time') ,
175 'description' => 'date on which this job becomes available; null if ASAP',
176 'html' => array(
177 'type' => 'Select Date',
178 ) ,
179 ) ,
180 'data' => array(
181 'name' => 'data',
182 'type' => CRM_Utils_Type::T_TEXT,
183 'title' => ts('Queue item datas') ,
184 'description' => 'Serialized queue',
185 ) ,
186 );
187 }
188 return self::$_fields;
189 }
190 /**
191 * Returns an array containing, for each field, the arary key used for that
192 * field in self::$_fields.
193 *
194 * @return array
195 */
196 static function &fieldKeys() {
197 if (!(self::$_fieldKeys)) {
198 self::$_fieldKeys = array(
199 'id' => 'id',
200 'queue_name' => 'queue_name',
201 'weight' => 'weight',
202 'submit_time' => 'submit_time',
203 'release_time' => 'release_time',
204 'data' => 'data',
205 );
206 }
207 return self::$_fieldKeys;
208 }
209 /**
210 * Returns the names of this table
211 *
212 * @return string
213 */
214 static function getTableName() {
215 return self::$_tableName;
216 }
217 /**
218 * Returns if this table needs to be logged
219 *
220 * @return boolean
221 */
222 function getLog() {
223 return self::$_log;
224 }
225 /**
226 * Returns the list of fields that can be imported
227 *
228 * @param bool $prefix
229 *
230 * @return array
231 */
232 static function &import($prefix = false) {
233 if (!(self::$_import)) {
234 self::$_import = array();
235 $fields = self::fields();
236 foreach($fields as $name => $field) {
237 if (CRM_Utils_Array::value('import', $field)) {
238 if ($prefix) {
239 self::$_import['queue_item'] = & $fields[$name];
240 } else {
241 self::$_import[$name] = & $fields[$name];
242 }
243 }
244 }
245 }
246 return self::$_import;
247 }
248 /**
249 * Returns the list of fields that can be exported
250 *
251 * @param bool $prefix
252 *
253 * @return array
254 */
255 static function &export($prefix = false) {
256 if (!(self::$_export)) {
257 self::$_export = array();
258 $fields = self::fields();
259 foreach($fields as $name => $field) {
260 if (CRM_Utils_Array::value('export', $field)) {
261 if ($prefix) {
262 self::$_export['queue_item'] = & $fields[$name];
263 } else {
264 self::$_export[$name] = & $fields[$name];
265 }
266 }
267 }
268 }
269 return self::$_export;
270 }
271 }