fixup CRM-14885 - Import DAOs
[civicrm-core.git] / CRM / Core / DAO / UFGroup.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/Core/UFGroup.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:0428de652198e17e9b651a08e38f9cc4)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_UFGroup extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_uf_group';
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 = true;
83 /**
84 * Unique table ID
85 *
86 * @var int unsigned
87 */
88 public $id;
89 /**
90 * Is this form currently active? If false, hide all related fields for all sharing contexts.
91 *
92 * @var boolean
93 */
94 public $is_active;
95 /**
96 * This column will store a comma separated list of the type(s) of profile fields.
97 *
98 * @var string
99 */
100 public $group_type;
101 /**
102 * Form title.
103 *
104 * @var string
105 */
106 public $title;
107 /**
108 * Optional verbose description of the profile.
109 *
110 * @var text
111 */
112 public $description;
113 /**
114 * Description and/or help text to display before fields in form.
115 *
116 * @var text
117 */
118 public $help_pre;
119 /**
120 * Description and/or help text to display after fields in form.
121 *
122 * @var text
123 */
124 public $help_post;
125 /**
126 * Group id, foreign key from civicrm_group
127 *
128 * @var int unsigned
129 */
130 public $limit_listings_group_id;
131 /**
132 * Redirect to URL.
133 *
134 * @var string
135 */
136 public $post_URL;
137 /**
138 * foreign key to civicrm_group_id
139 *
140 * @var int unsigned
141 */
142 public $add_to_group_id;
143 /**
144 * Should a CAPTCHA widget be included this Profile form.
145 *
146 * @var boolean
147 */
148 public $add_captcha;
149 /**
150 * Do we want to map results from this profile.
151 *
152 * @var boolean
153 */
154 public $is_map;
155 /**
156 * Should edit link display in profile selector
157 *
158 * @var boolean
159 */
160 public $is_edit_link;
161 /**
162 * Should we display a link to the website profile in profile selector
163 *
164 * @var boolean
165 */
166 public $is_uf_link;
167 /**
168 * Should we update the contact record if we find a duplicate
169 *
170 * @var boolean
171 */
172 public $is_update_dupe;
173 /**
174 * Redirect to URL when Cancle button clik .
175 *
176 * @var string
177 */
178 public $cancel_URL;
179 /**
180 * Should we create a cms user for this profile
181 *
182 * @var boolean
183 */
184 public $is_cms_user;
185 /**
186 *
187 * @var text
188 */
189 public $notify;
190 /**
191 * Is this group reserved for use by some other CiviCRM functionality?
192 *
193 * @var boolean
194 */
195 public $is_reserved;
196 /**
197 * Name of the UF group for directly addressing it in the codebase
198 *
199 * @var string
200 */
201 public $name;
202 /**
203 * FK to civicrm_contact, who created this UF group
204 *
205 * @var int unsigned
206 */
207 public $created_id;
208 /**
209 * Date and time this UF group was created.
210 *
211 * @var datetime
212 */
213 public $created_date;
214 /**
215 * Should we include proximity search feature in this profile search form?
216 *
217 * @var boolean
218 */
219 public $is_proximity_search;
220 /**
221 * class constructor
222 *
223 * @return civicrm_uf_group
224 */
225 function __construct() {
226 $this->__table = 'civicrm_uf_group';
227 parent::__construct();
228 }
229 /**
230 * Returns foreign keys and entity references
231 *
232 * @return array
233 * [CRM_Core_Reference_Interface]
234 */
235 static function getReferenceColumns() {
236 if (!self::$_links) {
237 self::$_links = static ::createReferenceColumns(__CLASS__);
238 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'limit_listings_group_id', 'civicrm_group', 'id');
239 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'add_to_group_id', 'civicrm_group', 'id');
240 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id');
241 }
242 return self::$_links;
243 }
244 /**
245 * Returns all the column names of this table
246 *
247 * @return array
248 */
249 static function &fields() {
250 if (!(self::$_fields)) {
251 self::$_fields = array(
252 'id' => array(
253 'name' => 'id',
254 'type' => CRM_Utils_Type::T_INT,
255 'title' => ts('Profile ID') ,
256 'description' => 'Unique table ID',
257 'required' => true,
258 ) ,
259 'is_active' => array(
260 'name' => 'is_active',
261 'type' => CRM_Utils_Type::T_BOOLEAN,
262 'title' => ts('Profile Is Active') ,
263 'description' => 'Is this form currently active? If false, hide all related fields for all sharing contexts.',
264 'default' => '1',
265 ) ,
266 'group_type' => array(
267 'name' => 'group_type',
268 'type' => CRM_Utils_Type::T_STRING,
269 'title' => ts('Profile Group Type') ,
270 'description' => 'This column will store a comma separated list of the type(s) of profile fields.',
271 'maxlength' => 255,
272 'size' => CRM_Utils_Type::HUGE,
273 'import' => true,
274 'where' => 'civicrm_uf_group.group_type',
275 'headerPattern' => '',
276 'dataPattern' => '',
277 'export' => true,
278 ) ,
279 'title' => array(
280 'name' => 'title',
281 'type' => CRM_Utils_Type::T_STRING,
282 'title' => ts('Title') ,
283 'description' => 'Form title.',
284 'required' => true,
285 'maxlength' => 64,
286 'size' => CRM_Utils_Type::BIG,
287 ) ,
288 'description' => array(
289 'name' => 'description',
290 'type' => CRM_Utils_Type::T_TEXT,
291 'title' => ts('Profile Description') ,
292 'description' => 'Optional verbose description of the profile.',
293 'rows' => 2,
294 'cols' => 60,
295 'html' => array(
296 'type' => 'TextArea',
297 ) ,
298 ) ,
299 'help_pre' => array(
300 'name' => 'help_pre',
301 'type' => CRM_Utils_Type::T_TEXT,
302 'title' => ts('Help Pre') ,
303 'description' => 'Description and/or help text to display before fields in form.',
304 'rows' => 4,
305 'cols' => 80,
306 'html' => array(
307 'type' => 'TextArea',
308 ) ,
309 ) ,
310 'help_post' => array(
311 'name' => 'help_post',
312 'type' => CRM_Utils_Type::T_TEXT,
313 'title' => ts('Profile Post Text') ,
314 'description' => 'Description and/or help text to display after fields in form.',
315 'rows' => 4,
316 'cols' => 80,
317 'html' => array(
318 'type' => 'TextArea',
319 ) ,
320 ) ,
321 'limit_listings_group_id' => array(
322 'name' => 'limit_listings_group_id',
323 'type' => CRM_Utils_Type::T_INT,
324 'title' => ts('Profile Search Limit Group') ,
325 'description' => 'Group id, foreign key from civicrm_group',
326 'FKClassName' => 'CRM_Contact_DAO_Group',
327 ) ,
328 'post_URL' => array(
329 'name' => 'post_URL',
330 'type' => CRM_Utils_Type::T_STRING,
331 'title' => ts('Post Url') ,
332 'description' => 'Redirect to URL.',
333 'maxlength' => 255,
334 'size' => CRM_Utils_Type::HUGE,
335 ) ,
336 'add_to_group_id' => array(
337 'name' => 'add_to_group_id',
338 'type' => CRM_Utils_Type::T_INT,
339 'title' => ts('Add Contact To Group') ,
340 'description' => 'foreign key to civicrm_group_id',
341 'FKClassName' => 'CRM_Contact_DAO_Group',
342 ) ,
343 'add_captcha' => array(
344 'name' => 'add_captcha',
345 'type' => CRM_Utils_Type::T_BOOLEAN,
346 'title' => ts('Show Captcha On Profile') ,
347 'description' => 'Should a CAPTCHA widget be included this Profile form.',
348 ) ,
349 'is_map' => array(
350 'name' => 'is_map',
351 'type' => CRM_Utils_Type::T_BOOLEAN,
352 'title' => ts('Map Profile') ,
353 'description' => 'Do we want to map results from this profile.',
354 ) ,
355 'is_edit_link' => array(
356 'name' => 'is_edit_link',
357 'type' => CRM_Utils_Type::T_BOOLEAN,
358 'title' => ts('Show Edit Link?') ,
359 'description' => 'Should edit link display in profile selector',
360 ) ,
361 'is_uf_link' => array(
362 'name' => 'is_uf_link',
363 'type' => CRM_Utils_Type::T_BOOLEAN,
364 'title' => ts('Show Link to CMS User') ,
365 'description' => 'Should we display a link to the website profile in profile selector',
366 ) ,
367 'is_update_dupe' => array(
368 'name' => 'is_update_dupe',
369 'type' => CRM_Utils_Type::T_BOOLEAN,
370 'title' => ts('Update on Duplicate') ,
371 'description' => 'Should we update the contact record if we find a duplicate',
372 ) ,
373 'cancel_URL' => array(
374 'name' => 'cancel_URL',
375 'type' => CRM_Utils_Type::T_STRING,
376 'title' => ts('Profile Cancel URL') ,
377 'description' => 'Redirect to URL when Cancle button clik .',
378 'maxlength' => 255,
379 'size' => CRM_Utils_Type::HUGE,
380 ) ,
381 'is_cms_user' => array(
382 'name' => 'is_cms_user',
383 'type' => CRM_Utils_Type::T_BOOLEAN,
384 'title' => ts('Create CMS User?') ,
385 'description' => 'Should we create a cms user for this profile ',
386 ) ,
387 'notify' => array(
388 'name' => 'notify',
389 'type' => CRM_Utils_Type::T_TEXT,
390 'title' => ts('Notify on Profile Submit') ,
391 ) ,
392 'is_reserved' => array(
393 'name' => 'is_reserved',
394 'type' => CRM_Utils_Type::T_BOOLEAN,
395 'title' => ts('Profile Is Reserved') ,
396 'description' => 'Is this group reserved for use by some other CiviCRM functionality?',
397 ) ,
398 'name' => array(
399 'name' => 'name',
400 'type' => CRM_Utils_Type::T_STRING,
401 'title' => ts('Profile Name') ,
402 'description' => 'Name of the UF group for directly addressing it in the codebase',
403 'maxlength' => 64,
404 'size' => CRM_Utils_Type::BIG,
405 ) ,
406 'created_id' => array(
407 'name' => 'created_id',
408 'type' => CRM_Utils_Type::T_INT,
409 'title' => ts('Profile Created By') ,
410 'description' => 'FK to civicrm_contact, who created this UF group',
411 'FKClassName' => 'CRM_Contact_DAO_Contact',
412 ) ,
413 'created_date' => array(
414 'name' => 'created_date',
415 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
416 'title' => ts('UF Group Created Date') ,
417 'description' => 'Date and time this UF group was created.',
418 ) ,
419 'is_proximity_search' => array(
420 'name' => 'is_proximity_search',
421 'type' => CRM_Utils_Type::T_BOOLEAN,
422 'title' => ts('Include Proximity Search?') ,
423 'description' => 'Should we include proximity search feature in this profile search form?',
424 ) ,
425 );
426 }
427 return self::$_fields;
428 }
429 /**
430 * Returns an array containing, for each field, the arary key used for that
431 * field in self::$_fields.
432 *
433 * @return array
434 */
435 static function &fieldKeys() {
436 if (!(self::$_fieldKeys)) {
437 self::$_fieldKeys = array(
438 'id' => 'id',
439 'is_active' => 'is_active',
440 'group_type' => 'group_type',
441 'title' => 'title',
442 'description' => 'description',
443 'help_pre' => 'help_pre',
444 'help_post' => 'help_post',
445 'limit_listings_group_id' => 'limit_listings_group_id',
446 'post_URL' => 'post_URL',
447 'add_to_group_id' => 'add_to_group_id',
448 'add_captcha' => 'add_captcha',
449 'is_map' => 'is_map',
450 'is_edit_link' => 'is_edit_link',
451 'is_uf_link' => 'is_uf_link',
452 'is_update_dupe' => 'is_update_dupe',
453 'cancel_URL' => 'cancel_URL',
454 'is_cms_user' => 'is_cms_user',
455 'notify' => 'notify',
456 'is_reserved' => 'is_reserved',
457 'name' => 'name',
458 'created_id' => 'created_id',
459 'created_date' => 'created_date',
460 'is_proximity_search' => 'is_proximity_search',
461 );
462 }
463 return self::$_fieldKeys;
464 }
465 /**
466 * Returns the names of this table
467 *
468 * @return string
469 */
470 static function getTableName() {
471 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
472 }
473 /**
474 * Returns if this table needs to be logged
475 *
476 * @return boolean
477 */
478 function getLog() {
479 return self::$_log;
480 }
481 /**
482 * Returns the list of fields that can be imported
483 *
484 * @param bool $prefix
485 *
486 * @return array
487 */
488 static function &import($prefix = false) {
489 if (!(self::$_import)) {
490 self::$_import = array();
491 $fields = self::fields();
492 foreach($fields as $name => $field) {
493 if (CRM_Utils_Array::value('import', $field)) {
494 if ($prefix) {
495 self::$_import['uf_group'] = & $fields[$name];
496 } else {
497 self::$_import[$name] = & $fields[$name];
498 }
499 }
500 }
501 }
502 return self::$_import;
503 }
504 /**
505 * Returns the list of fields that can be exported
506 *
507 * @param bool $prefix
508 *
509 * @return array
510 */
511 static function &export($prefix = false) {
512 if (!(self::$_export)) {
513 self::$_export = array();
514 $fields = self::fields();
515 foreach($fields as $name => $field) {
516 if (CRM_Utils_Array::value('export', $field)) {
517 if ($prefix) {
518 self::$_export['uf_group'] = & $fields[$name];
519 } else {
520 self::$_export[$name] = & $fields[$name];
521 }
522 }
523 }
524 }
525 return self::$_export;
526 }
527 }