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