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