commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / civicrm / CRM / Case / DAO / Case.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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-2015
30 *
31 * Generated from xml/schema/CRM/Case/Case.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 */
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Case_DAO_Case extends CRM_Core_DAO {
37 /**
38 * static instance to hold the table name
39 *
40 * @var string
41 */
42 static $_tableName = 'civicrm_case';
43 /**
44 * static instance to hold the field values
45 *
46 * @var array
47 */
48 static $_fields = null;
49 /**
50 * static instance to hold the keys used in $_fields for each field.
51 *
52 * @var array
53 */
54 static $_fieldKeys = null;
55 /**
56 * static instance to hold the FK relationships
57 *
58 * @var string
59 */
60 static $_links = null;
61 /**
62 * static instance to hold the values that can
63 * be imported
64 *
65 * @var array
66 */
67 static $_import = null;
68 /**
69 * static instance to hold the values that can
70 * be exported
71 *
72 * @var array
73 */
74 static $_export = null;
75 /**
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
78 *
79 * @var boolean
80 */
81 static $_log = true;
82 /**
83 * Unique Case ID
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * FK to civicrm_case_type.id
90 *
91 * @var int unsigned
92 */
93 public $case_type_id;
94 /**
95 * Short name of the case.
96 *
97 * @var string
98 */
99 public $subject;
100 /**
101 * Date on which given case starts.
102 *
103 * @var date
104 */
105 public $start_date;
106 /**
107 * Date on which given case ends.
108 *
109 * @var date
110 */
111 public $end_date;
112 /**
113 * Details about the meeting (agenda, notes, etc).
114 *
115 * @var text
116 */
117 public $details;
118 /**
119 * Id of case status.
120 *
121 * @var int unsigned
122 */
123 public $status_id;
124 /**
125 *
126 * @var boolean
127 */
128 public $is_deleted;
129 /**
130 * class constructor
131 *
132 * @return civicrm_case
133 */
134 function __construct() {
135 $this->__table = 'civicrm_case';
136 parent::__construct();
137 }
138 /**
139 * Returns foreign keys and entity references
140 *
141 * @return array
142 * [CRM_Core_Reference_Interface]
143 */
144 static function getReferenceColumns() {
145 if (!self::$_links) {
146 self::$_links = static ::createReferenceColumns(__CLASS__);
147 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'case_type_id', 'civicrm_case_type', '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 'case_id' => array(
160 'name' => 'id',
161 'type' => CRM_Utils_Type::T_INT,
162 'title' => ts('Case ID') ,
163 'description' => 'Unique Case ID',
164 'required' => true,
165 'import' => true,
166 'where' => 'civicrm_case.id',
167 'headerPattern' => '',
168 'dataPattern' => '',
169 'export' => true,
170 ) ,
171 'case_type_id' => array(
172 'name' => 'case_type_id',
173 'type' => CRM_Utils_Type::T_INT,
174 'title' => ts('Case Type') ,
175 'description' => 'FK to civicrm_case_type.id',
176 'import' => true,
177 'where' => 'civicrm_case.case_type_id',
178 'headerPattern' => '',
179 'dataPattern' => '',
180 'export' => false,
181 'FKClassName' => 'CRM_Case_DAO_CaseType',
182 'html' => array(
183 'type' => 'Select',
184 ) ,
185 'pseudoconstant' => array(
186 'table' => 'civicrm_case_type',
187 'keyColumn' => 'id',
188 'labelColumn' => 'title',
189 )
190 ) ,
191 'case_subject' => array(
192 'name' => 'subject',
193 'type' => CRM_Utils_Type::T_STRING,
194 'title' => ts('Case Subject') ,
195 'description' => 'Short name of the case.',
196 'maxlength' => 128,
197 'size' => CRM_Utils_Type::HUGE,
198 'import' => true,
199 'where' => 'civicrm_case.subject',
200 'headerPattern' => '',
201 'dataPattern' => '',
202 'export' => true,
203 'html' => array(
204 'type' => 'Text',
205 ) ,
206 ) ,
207 'case_start_date' => array(
208 'name' => 'start_date',
209 'type' => CRM_Utils_Type::T_DATE,
210 'title' => ts('Case Start Date') ,
211 'description' => 'Date on which given case starts.',
212 'import' => true,
213 'where' => 'civicrm_case.start_date',
214 'headerPattern' => '',
215 'dataPattern' => '',
216 'export' => true,
217 'html' => array(
218 'type' => 'Select Date',
219 ) ,
220 ) ,
221 'case_end_date' => array(
222 'name' => 'end_date',
223 'type' => CRM_Utils_Type::T_DATE,
224 'title' => ts('Case End Date') ,
225 'description' => 'Date on which given case ends.',
226 'import' => true,
227 'where' => 'civicrm_case.end_date',
228 'headerPattern' => '',
229 'dataPattern' => '',
230 'export' => true,
231 'html' => array(
232 'type' => 'Select Date',
233 ) ,
234 ) ,
235 'details' => array(
236 'name' => 'details',
237 'type' => CRM_Utils_Type::T_TEXT,
238 'title' => ts('Details') ,
239 'description' => 'Details about the meeting (agenda, notes, etc).',
240 'rows' => 8,
241 'cols' => 60,
242 'html' => array(
243 'type' => 'TextArea',
244 ) ,
245 ) ,
246 'case_status_id' => array(
247 'name' => 'status_id',
248 'type' => CRM_Utils_Type::T_INT,
249 'title' => ts('Case Status') ,
250 'description' => 'Id of case status.',
251 'required' => true,
252 'import' => true,
253 'where' => 'civicrm_case.status_id',
254 'headerPattern' => '',
255 'dataPattern' => '',
256 'export' => false,
257 'html' => array(
258 'type' => 'Select',
259 ) ,
260 'pseudoconstant' => array(
261 'optionGroupName' => 'case_status',
262 'optionEditPath' => 'civicrm/admin/options/case_status',
263 )
264 ) ,
265 'case_deleted' => array(
266 'name' => 'is_deleted',
267 'type' => CRM_Utils_Type::T_BOOLEAN,
268 'title' => ts('Case is in the Trash') ,
269 'import' => true,
270 'where' => 'civicrm_case.is_deleted',
271 'headerPattern' => '',
272 'dataPattern' => '',
273 'export' => true,
274 ) ,
275 );
276 }
277 return self::$_fields;
278 }
279 /**
280 * Returns an array containing, for each field, the arary key used for that
281 * field in self::$_fields.
282 *
283 * @return array
284 */
285 static function &fieldKeys() {
286 if (!(self::$_fieldKeys)) {
287 self::$_fieldKeys = array(
288 'id' => 'case_id',
289 'case_type_id' => 'case_type_id',
290 'subject' => 'case_subject',
291 'start_date' => 'case_start_date',
292 'end_date' => 'case_end_date',
293 'details' => 'details',
294 'status_id' => 'case_status_id',
295 'is_deleted' => 'case_deleted',
296 );
297 }
298 return self::$_fieldKeys;
299 }
300 /**
301 * Returns the names of this table
302 *
303 * @return string
304 */
305 static function getTableName() {
306 return self::$_tableName;
307 }
308 /**
309 * Returns if this table needs to be logged
310 *
311 * @return boolean
312 */
313 function getLog() {
314 return self::$_log;
315 }
316 /**
317 * Returns the list of fields that can be imported
318 *
319 * @param bool $prefix
320 *
321 * @return array
322 */
323 static function &import($prefix = false) {
324 if (!(self::$_import)) {
325 self::$_import = array();
326 $fields = self::fields();
327 foreach($fields as $name => $field) {
328 if (CRM_Utils_Array::value('import', $field)) {
329 if ($prefix) {
330 self::$_import['case'] = & $fields[$name];
331 } else {
332 self::$_import[$name] = & $fields[$name];
333 }
334 }
335 }
336 }
337 return self::$_import;
338 }
339 /**
340 * Returns the list of fields that can be exported
341 *
342 * @param bool $prefix
343 *
344 * @return array
345 */
346 static function &export($prefix = false) {
347 if (!(self::$_export)) {
348 self::$_export = array();
349 $fields = self::fields();
350 foreach($fields as $name => $field) {
351 if (CRM_Utils_Array::value('export', $field)) {
352 if ($prefix) {
353 self::$_export['case'] = & $fields[$name];
354 } else {
355 self::$_export[$name] = & $fields[$name];
356 }
357 }
358 }
359 }
360 return self::$_export;
361 }
362 }