Regenerate DAO files
[civicrm-core.git] / CRM / Core / DAO / UFJoin.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Core/UFJoin.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:191143bced279d48cf34cdf6cf85a5fb)
10 */
11
12 /**
13 * Database access object for the UFJoin entity.
14 */
15 class CRM_Core_DAO_UFJoin extends CRM_Core_DAO {
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '1.3';
18
19 /**
20 * Static instance to hold the table name.
21 *
22 * @var string
23 */
24 public static $_tableName = 'civicrm_uf_join';
25
26 /**
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
28 *
29 * @var bool
30 */
31 public static $_log = TRUE;
32
33 /**
34 * Unique table ID
35 *
36 * @var int
37 */
38 public $id;
39
40 /**
41 * Is this join currently active?
42 *
43 * @var bool
44 */
45 public $is_active;
46
47 /**
48 * Module which owns this uf_join instance, e.g. User Registration, CiviDonate, etc.
49 *
50 * @var string
51 */
52 public $module;
53
54 /**
55 * 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.
56 *
57 * @var string
58 */
59 public $entity_table;
60
61 /**
62 * Foreign key to the referenced item.
63 *
64 * @var int
65 */
66 public $entity_id;
67
68 /**
69 * Controls display order when multiple user framework groups are setup for concurrent display.
70 *
71 * @var int
72 */
73 public $weight;
74
75 /**
76 * Which form does this field belong to.
77 *
78 * @var int
79 */
80 public $uf_group_id;
81
82 /**
83 * Json serialized array of data used by the ufjoin.module
84 *
85 * @var longtext
86 */
87 public $module_data;
88
89 /**
90 * Class constructor.
91 */
92 public function __construct() {
93 $this->__table = 'civicrm_uf_join';
94 parent::__construct();
95 }
96
97 /**
98 * Returns localized title of this entity.
99 */
100 public static function getEntityTitle() {
101 return ts('UFJoins');
102 }
103
104 /**
105 * Returns foreign keys and entity references.
106 *
107 * @return array
108 * [CRM_Core_Reference_Interface]
109 */
110 public static function getReferenceColumns() {
111 if (!isset(Civi::$statics[__CLASS__]['links'])) {
112 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
113 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'uf_group_id', 'civicrm_uf_group', 'id');
114 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Dynamic(self::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
115 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
116 }
117 return Civi::$statics[__CLASS__]['links'];
118 }
119
120 /**
121 * Returns all the column names of this table
122 *
123 * @return array
124 */
125 public static function &fields() {
126 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
127 Civi::$statics[__CLASS__]['fields'] = [
128 'id' => [
129 'name' => 'id',
130 'type' => CRM_Utils_Type::T_INT,
131 'title' => ts('UF Join ID'),
132 'description' => ts('Unique table ID'),
133 'required' => TRUE,
134 'where' => 'civicrm_uf_join.id',
135 'table_name' => 'civicrm_uf_join',
136 'entity' => 'UFJoin',
137 'bao' => 'CRM_Core_BAO_UFJoin',
138 'localizable' => 0,
139 'add' => '1.3',
140 ],
141 'is_active' => [
142 'name' => 'is_active',
143 'type' => CRM_Utils_Type::T_BOOLEAN,
144 'title' => ts('Profile Use is active'),
145 'description' => ts('Is this join currently active?'),
146 'where' => 'civicrm_uf_join.is_active',
147 'default' => '1',
148 'table_name' => 'civicrm_uf_join',
149 'entity' => 'UFJoin',
150 'bao' => 'CRM_Core_BAO_UFJoin',
151 'localizable' => 0,
152 'add' => '1.3',
153 ],
154 'module' => [
155 'name' => 'module',
156 'type' => CRM_Utils_Type::T_STRING,
157 'title' => ts('Profile Module'),
158 'description' => ts('Module which owns this uf_join instance, e.g. User Registration, CiviDonate, etc.'),
159 'required' => TRUE,
160 'maxlength' => 64,
161 'size' => CRM_Utils_Type::BIG,
162 'where' => 'civicrm_uf_join.module',
163 'table_name' => 'civicrm_uf_join',
164 'entity' => 'UFJoin',
165 'bao' => 'CRM_Core_BAO_UFJoin',
166 'localizable' => 0,
167 'add' => '1.3',
168 ],
169 'entity_table' => [
170 'name' => 'entity_table',
171 'type' => CRM_Utils_Type::T_STRING,
172 'title' => ts('Profile Entity Table'),
173 'description' => ts('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.'),
174 'maxlength' => 64,
175 'size' => CRM_Utils_Type::BIG,
176 'where' => 'civicrm_uf_join.entity_table',
177 'table_name' => 'civicrm_uf_join',
178 'entity' => 'UFJoin',
179 'bao' => 'CRM_Core_BAO_UFJoin',
180 'localizable' => 0,
181 'pseudoconstant' => [
182 'callback' => 'CRM_Core_BAO_UFJoin::entityTables',
183 ],
184 'add' => '1.3',
185 ],
186 'entity_id' => [
187 'name' => 'entity_id',
188 'type' => CRM_Utils_Type::T_INT,
189 'title' => ts('Profile Entity ID'),
190 'description' => ts('Foreign key to the referenced item.'),
191 'where' => 'civicrm_uf_join.entity_id',
192 'table_name' => 'civicrm_uf_join',
193 'entity' => 'UFJoin',
194 'bao' => 'CRM_Core_BAO_UFJoin',
195 'localizable' => 0,
196 'add' => '1.3',
197 ],
198 'weight' => [
199 'name' => 'weight',
200 'type' => CRM_Utils_Type::T_INT,
201 'title' => ts('Order'),
202 'description' => ts('Controls display order when multiple user framework groups are setup for concurrent display.'),
203 'required' => TRUE,
204 'where' => 'civicrm_uf_join.weight',
205 'default' => '1',
206 'table_name' => 'civicrm_uf_join',
207 'entity' => 'UFJoin',
208 'bao' => 'CRM_Core_BAO_UFJoin',
209 'localizable' => 0,
210 'add' => '1.3',
211 ],
212 'uf_group_id' => [
213 'name' => 'uf_group_id',
214 'type' => CRM_Utils_Type::T_INT,
215 'title' => ts('Profile ID'),
216 'description' => ts('Which form does this field belong to.'),
217 'required' => TRUE,
218 'where' => 'civicrm_uf_join.uf_group_id',
219 'table_name' => 'civicrm_uf_join',
220 'entity' => 'UFJoin',
221 'bao' => 'CRM_Core_BAO_UFJoin',
222 'localizable' => 0,
223 'FKClassName' => 'CRM_Core_DAO_UFGroup',
224 'html' => [
225 'type' => 'Select',
226 ],
227 'pseudoconstant' => [
228 'table' => 'civicrm_uf_group',
229 'keyColumn' => 'id',
230 'labelColumn' => 'title',
231 ],
232 'add' => '1.3',
233 ],
234 'module_data' => [
235 'name' => 'module_data',
236 'type' => CRM_Utils_Type::T_LONGTEXT,
237 'title' => ts('Profile Use Data'),
238 'description' => ts('Json serialized array of data used by the ufjoin.module'),
239 'where' => 'civicrm_uf_join.module_data',
240 'table_name' => 'civicrm_uf_join',
241 'entity' => 'UFJoin',
242 'bao' => 'CRM_Core_BAO_UFJoin',
243 'localizable' => 0,
244 'serialize' => self::SERIALIZE_JSON,
245 'add' => '4.5',
246 ],
247 ];
248 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
249 }
250 return Civi::$statics[__CLASS__]['fields'];
251 }
252
253 /**
254 * Return a mapping from field-name to the corresponding key (as used in fields()).
255 *
256 * @return array
257 * Array(string $name => string $uniqueName).
258 */
259 public static function &fieldKeys() {
260 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
261 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
262 }
263 return Civi::$statics[__CLASS__]['fieldKeys'];
264 }
265
266 /**
267 * Returns the names of this table
268 *
269 * @return string
270 */
271 public static function getTableName() {
272 return self::$_tableName;
273 }
274
275 /**
276 * Returns if this table needs to be logged
277 *
278 * @return bool
279 */
280 public function getLog() {
281 return self::$_log;
282 }
283
284 /**
285 * Returns the list of fields that can be imported
286 *
287 * @param bool $prefix
288 *
289 * @return array
290 */
291 public static function &import($prefix = FALSE) {
292 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'uf_join', $prefix, []);
293 return $r;
294 }
295
296 /**
297 * Returns the list of fields that can be exported
298 *
299 * @param bool $prefix
300 *
301 * @return array
302 */
303 public static function &export($prefix = FALSE) {
304 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'uf_join', $prefix, []);
305 return $r;
306 }
307
308 /**
309 * Returns the list of indices
310 *
311 * @param bool $localize
312 *
313 * @return array
314 */
315 public static function indices($localize = TRUE) {
316 $indices = [
317 'index_entity' => [
318 'name' => 'index_entity',
319 'field' => [
320 0 => 'entity_table',
321 1 => 'entity_id',
322 ],
323 'localizable' => FALSE,
324 'sig' => 'civicrm_uf_join::0::entity_table::entity_id',
325 ],
326 ];
327 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
328 }
329
330 }