commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-old / civicrm / CRM / Core / DAO / UFJoin.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/Core/UFJoin.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_Core_DAO_UFJoin extends CRM_Core_DAO {
37 /**
38 * static instance to hold the table name
39 *
40 * @var string
41 */
42 static $_tableName = 'civicrm_uf_join';
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 table ID
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * Is this join currently active?
90 *
91 * @var boolean
92 */
93 public $is_active;
94 /**
95 * Module which owns this uf_join instance, e.g. User Registration, CiviDonate, etc.
96 *
97 * @var string
98 */
99 public $module;
100 /**
101 * Name of table where item being referenced is stored. Modules which only need a single collection of uf_join instances may choose not to populate entity_table and entity_id.
102 *
103 * @var string
104 */
105 public $entity_table;
106 /**
107 * Foreign key to the referenced item.
108 *
109 * @var int unsigned
110 */
111 public $entity_id;
112 /**
113 * Controls display order when multiple user framework groups are setup for concurrent display.
114 *
115 * @var int
116 */
117 public $weight;
118 /**
119 * Which form does this field belong to.
120 *
121 * @var int unsigned
122 */
123 public $uf_group_id;
124 /**
125 * Json serialized array of data used by the ufjoin.module
126 *
127 * @var longtext
128 */
129 public $module_data;
130 /**
131 * class constructor
132 *
133 * @return civicrm_uf_join
134 */
135 function __construct() {
136 $this->__table = 'civicrm_uf_join';
137 parent::__construct();
138 }
139 /**
140 * Returns foreign keys and entity references
141 *
142 * @return array
143 * [CRM_Core_Reference_Interface]
144 */
145 static function getReferenceColumns() {
146 if (!self::$_links) {
147 self::$_links = static ::createReferenceColumns(__CLASS__);
148 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'uf_group_id', 'civicrm_uf_group', 'id');
149 self::$_links[] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
150 }
151 return self::$_links;
152 }
153 /**
154 * Returns all the column names of this table
155 *
156 * @return array
157 */
158 static function &fields() {
159 if (!(self::$_fields)) {
160 self::$_fields = array(
161 'id' => array(
162 'name' => 'id',
163 'type' => CRM_Utils_Type::T_INT,
164 'title' => ts('UF Join ID') ,
165 'description' => 'Unique table ID',
166 'required' => true,
167 ) ,
168 'is_active' => array(
169 'name' => 'is_active',
170 'type' => CRM_Utils_Type::T_BOOLEAN,
171 'title' => ts('Profile Use is active') ,
172 'description' => 'Is this join currently active?',
173 'default' => '1',
174 ) ,
175 'module' => array(
176 'name' => 'module',
177 'type' => CRM_Utils_Type::T_STRING,
178 'title' => ts('Profile Module') ,
179 'description' => 'Module which owns this uf_join instance, e.g. User Registration, CiviDonate, etc.',
180 'required' => true,
181 'maxlength' => 64,
182 'size' => CRM_Utils_Type::BIG,
183 ) ,
184 'entity_table' => array(
185 'name' => 'entity_table',
186 'type' => CRM_Utils_Type::T_STRING,
187 'title' => ts('Profile Entity Table') ,
188 'description' => 'Name of table where item being referenced is stored. Modules which only need a single collection of uf_join instances may choose not to populate entity_table and entity_id.',
189 'maxlength' => 64,
190 'size' => CRM_Utils_Type::BIG,
191 ) ,
192 'entity_id' => array(
193 'name' => 'entity_id',
194 'type' => CRM_Utils_Type::T_INT,
195 'title' => ts('Profile Entity ID') ,
196 'description' => 'Foreign key to the referenced item.',
197 ) ,
198 'weight' => array(
199 'name' => 'weight',
200 'type' => CRM_Utils_Type::T_INT,
201 'title' => ts('Order') ,
202 'description' => 'Controls display order when multiple user framework groups are setup for concurrent display.',
203 'required' => true,
204 'default' => '1',
205 ) ,
206 'uf_group_id' => array(
207 'name' => 'uf_group_id',
208 'type' => CRM_Utils_Type::T_INT,
209 'title' => ts('Profile ID') ,
210 'description' => 'Which form does this field belong to.',
211 'required' => true,
212 'FKClassName' => 'CRM_Core_DAO_UFGroup',
213 'html' => array(
214 'type' => 'Select',
215 ) ,
216 'pseudoconstant' => array(
217 'table' => 'civicrm_uf_group',
218 'keyColumn' => 'id',
219 'labelColumn' => 'title',
220 )
221 ) ,
222 'module_data' => array(
223 'name' => 'module_data',
224 'type' => CRM_Utils_Type::T_LONGTEXT,
225 'title' => ts('Profile Use Data') ,
226 'description' => 'Json serialized array of data used by the ufjoin.module',
227 ) ,
228 );
229 }
230 return self::$_fields;
231 }
232 /**
233 * Returns an array containing, for each field, the arary key used for that
234 * field in self::$_fields.
235 *
236 * @return array
237 */
238 static function &fieldKeys() {
239 if (!(self::$_fieldKeys)) {
240 self::$_fieldKeys = array(
241 'id' => 'id',
242 'is_active' => 'is_active',
243 'module' => 'module',
244 'entity_table' => 'entity_table',
245 'entity_id' => 'entity_id',
246 'weight' => 'weight',
247 'uf_group_id' => 'uf_group_id',
248 'module_data' => 'module_data',
249 );
250 }
251 return self::$_fieldKeys;
252 }
253 /**
254 * Returns the names of this table
255 *
256 * @return string
257 */
258 static function getTableName() {
259 return self::$_tableName;
260 }
261 /**
262 * Returns if this table needs to be logged
263 *
264 * @return boolean
265 */
266 function getLog() {
267 return self::$_log;
268 }
269 /**
270 * Returns the list of fields that can be imported
271 *
272 * @param bool $prefix
273 *
274 * @return array
275 */
276 static function &import($prefix = false) {
277 if (!(self::$_import)) {
278 self::$_import = array();
279 $fields = self::fields();
280 foreach($fields as $name => $field) {
281 if (CRM_Utils_Array::value('import', $field)) {
282 if ($prefix) {
283 self::$_import['uf_join'] = & $fields[$name];
284 } else {
285 self::$_import[$name] = & $fields[$name];
286 }
287 }
288 }
289 }
290 return self::$_import;
291 }
292 /**
293 * Returns the list of fields that can be exported
294 *
295 * @param bool $prefix
296 *
297 * @return array
298 */
299 static function &export($prefix = false) {
300 if (!(self::$_export)) {
301 self::$_export = array();
302 $fields = self::fields();
303 foreach($fields as $name => $field) {
304 if (CRM_Utils_Array::value('export', $field)) {
305 if ($prefix) {
306 self::$_export['uf_join'] = & $fields[$name];
307 } else {
308 self::$_export[$name] = & $fields[$name];
309 }
310 }
311 }
312 }
313 return self::$_export;
314 }
315 }