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