Merge pull request #8944 from totten/master-givi
[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 value to see if we should log any modifications to
46 * this table in the civicrm_log table
47 *
48 * @var boolean
49 */
50 static $_log = true;
51 /**
52 * Unique table ID
53 *
54 * @var int unsigned
55 */
56 public $id;
57 /**
58 * Is this form currently active? If false, hide all related fields for all sharing contexts.
59 *
60 * @var boolean
61 */
62 public $is_active;
63 /**
64 * This column will store a comma separated list of the type(s) of profile fields.
65 *
66 * @var string
67 */
68 public $group_type;
69 /**
70 * Form title.
71 *
72 * @var string
73 */
74 public $title;
75 /**
76 * Optional verbose description of the profile.
77 *
78 * @var text
79 */
80 public $description;
81 /**
82 * Description and/or help text to display before fields in form.
83 *
84 * @var text
85 */
86 public $help_pre;
87 /**
88 * Description and/or help text to display after fields in form.
89 *
90 * @var text
91 */
92 public $help_post;
93 /**
94 * Group id, foreign key from civicrm_group
95 *
96 * @var int unsigned
97 */
98 public $limit_listings_group_id;
99 /**
100 * Redirect to URL.
101 *
102 * @var string
103 */
104 public $post_URL;
105 /**
106 * foreign key to civicrm_group_id
107 *
108 * @var int unsigned
109 */
110 public $add_to_group_id;
111 /**
112 * Should a CAPTCHA widget be included this Profile form.
113 *
114 * @var boolean
115 */
116 public $add_captcha;
117 /**
118 * Do we want to map results from this profile.
119 *
120 * @var boolean
121 */
122 public $is_map;
123 /**
124 * Should edit link display in profile selector
125 *
126 * @var boolean
127 */
128 public $is_edit_link;
129 /**
130 * Should we display a link to the website profile in profile selector
131 *
132 * @var boolean
133 */
134 public $is_uf_link;
135 /**
136 * Should we update the contact record if we find a duplicate
137 *
138 * @var boolean
139 */
140 public $is_update_dupe;
141 /**
142 * Redirect to URL when Cancle button clik .
143 *
144 * @var string
145 */
146 public $cancel_URL;
147 /**
148 * Should we create a cms user for this profile
149 *
150 * @var boolean
151 */
152 public $is_cms_user;
153 /**
154 *
155 * @var text
156 */
157 public $notify;
158 /**
159 * Is this group reserved for use by some other CiviCRM functionality?
160 *
161 * @var boolean
162 */
163 public $is_reserved;
164 /**
165 * Name of the UF group for directly addressing it in the codebase
166 *
167 * @var string
168 */
169 public $name;
170 /**
171 * FK to civicrm_contact, who created this UF group
172 *
173 * @var int unsigned
174 */
175 public $created_id;
176 /**
177 * Date and time this UF group was created.
178 *
179 * @var datetime
180 */
181 public $created_date;
182 /**
183 * Should we include proximity search feature in this profile search form?
184 *
185 * @var boolean
186 */
187 public $is_proximity_search;
188 /**
189 * class constructor
190 *
191 * @return civicrm_uf_group
192 */
193 function __construct() {
194 $this->__table = 'civicrm_uf_group';
195 parent::__construct();
196 }
197 /**
198 * Returns foreign keys and entity references
199 *
200 * @return array
201 * [CRM_Core_Reference_Interface]
202 */
203 static function getReferenceColumns() {
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']);
210 }
211 return Civi::$statics[__CLASS__]['links'];
212 }
213 /**
214 * Returns all the column names of this table
215 *
216 * @return array
217 */
218 static function &fields() {
219 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
220 Civi::$statics[__CLASS__]['fields'] = array(
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 );
395 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
396 }
397 return Civi::$statics[__CLASS__]['fields'];
398 }
399 /**
400 * Return a mapping from field-name to the corresponding key (as used in fields()).
401 *
402 * @return array
403 * Array(string $name => string $uniqueName).
404 */
405 static function &fieldKeys() {
406 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
407 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
408 }
409 return Civi::$statics[__CLASS__]['fieldKeys'];
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) {
435 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'uf_group', $prefix, array());
436 return $r;
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) {
446 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'uf_group', $prefix, array());
447 return $r;
448 }
449 }