Merge pull request #18165 from civicrm/5.29
[civicrm-core.git] / CRM / Core / DAO / UFMatch.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Core/UFMatch.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:4fca2151c2ecbd762ac9e2f067f0030f)
10 */
11
12 /**
13 * Database access object for the UFMatch entity.
14 */
15 class CRM_Core_DAO_UFMatch extends CRM_Core_DAO {
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '1.1';
18
19 /**
20 * Static instance to hold the table name.
21 *
22 * @var string
23 */
24 public static $_tableName = 'civicrm_uf_match';
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 * System generated ID.
35 *
36 * @var int
37 */
38 public $id;
39
40 /**
41 * Which Domain is this match entry for
42 *
43 * @var int
44 */
45 public $domain_id;
46
47 /**
48 * UF ID
49 *
50 * @var int
51 */
52 public $uf_id;
53
54 /**
55 * UF Name
56 *
57 * @var string
58 */
59 public $uf_name;
60
61 /**
62 * FK to Contact ID
63 *
64 * @var int
65 */
66 public $contact_id;
67
68 /**
69 * UI language preferred by the given user/contact
70 *
71 * @var string
72 */
73 public $language;
74
75 /**
76 * Class constructor.
77 */
78 public function __construct() {
79 $this->__table = 'civicrm_uf_match';
80 parent::__construct();
81 }
82
83 /**
84 * Returns localized title of this entity.
85 */
86 public static function getEntityTitle() {
87 return ts('UFMatches');
88 }
89
90 /**
91 * Returns foreign keys and entity references.
92 *
93 * @return array
94 * [CRM_Core_Reference_Interface]
95 */
96 public static function getReferenceColumns() {
97 if (!isset(Civi::$statics[__CLASS__]['links'])) {
98 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
99 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id');
100 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id');
101 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
102 }
103 return Civi::$statics[__CLASS__]['links'];
104 }
105
106 /**
107 * Returns all the column names of this table
108 *
109 * @return array
110 */
111 public static function &fields() {
112 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
113 Civi::$statics[__CLASS__]['fields'] = [
114 'id' => [
115 'name' => 'id',
116 'type' => CRM_Utils_Type::T_INT,
117 'title' => ts('UF Match ID'),
118 'description' => ts('System generated ID.'),
119 'required' => TRUE,
120 'where' => 'civicrm_uf_match.id',
121 'table_name' => 'civicrm_uf_match',
122 'entity' => 'UFMatch',
123 'bao' => 'CRM_Core_BAO_UFMatch',
124 'localizable' => 0,
125 'add' => '1.1',
126 ],
127 'domain_id' => [
128 'name' => 'domain_id',
129 'type' => CRM_Utils_Type::T_INT,
130 'title' => ts('UF Match Domain ID'),
131 'description' => ts('Which Domain is this match entry for'),
132 'required' => TRUE,
133 'where' => 'civicrm_uf_match.domain_id',
134 'table_name' => 'civicrm_uf_match',
135 'entity' => 'UFMatch',
136 'bao' => 'CRM_Core_BAO_UFMatch',
137 'localizable' => 0,
138 'FKClassName' => 'CRM_Core_DAO_Domain',
139 'pseudoconstant' => [
140 'table' => 'civicrm_domain',
141 'keyColumn' => 'id',
142 'labelColumn' => 'name',
143 ],
144 'add' => '3.0',
145 ],
146 'uf_id' => [
147 'name' => 'uf_id',
148 'type' => CRM_Utils_Type::T_INT,
149 'title' => ts('CMS ID'),
150 'description' => ts('UF ID'),
151 'required' => TRUE,
152 'where' => 'civicrm_uf_match.uf_id',
153 'table_name' => 'civicrm_uf_match',
154 'entity' => 'UFMatch',
155 'bao' => 'CRM_Core_BAO_UFMatch',
156 'localizable' => 0,
157 'add' => '1.1',
158 ],
159 'uf_name' => [
160 'name' => 'uf_name',
161 'type' => CRM_Utils_Type::T_STRING,
162 'title' => ts('CMS Unique Identifier'),
163 'description' => ts('UF Name'),
164 'maxlength' => 128,
165 'size' => CRM_Utils_Type::HUGE,
166 'where' => 'civicrm_uf_match.uf_name',
167 'table_name' => 'civicrm_uf_match',
168 'entity' => 'UFMatch',
169 'bao' => 'CRM_Core_BAO_UFMatch',
170 'localizable' => 0,
171 'add' => '1.9.kabissa',
172 ],
173 'contact_id' => [
174 'name' => 'contact_id',
175 'type' => CRM_Utils_Type::T_INT,
176 'title' => ts('CiviCRM Contact ID'),
177 'description' => ts('FK to Contact ID'),
178 'where' => 'civicrm_uf_match.contact_id',
179 'table_name' => 'civicrm_uf_match',
180 'entity' => 'UFMatch',
181 'bao' => 'CRM_Core_BAO_UFMatch',
182 'localizable' => 0,
183 'FKClassName' => 'CRM_Contact_DAO_Contact',
184 'add' => '1.1',
185 ],
186 'language' => [
187 'name' => 'language',
188 'type' => CRM_Utils_Type::T_STRING,
189 'title' => ts('Preferred Language'),
190 'description' => ts('UI language preferred by the given user/contact'),
191 'maxlength' => 5,
192 'size' => CRM_Utils_Type::SIX,
193 'where' => 'civicrm_uf_match.language',
194 'table_name' => 'civicrm_uf_match',
195 'entity' => 'UFMatch',
196 'bao' => 'CRM_Core_BAO_UFMatch',
197 'localizable' => 0,
198 'add' => '2.1',
199 ],
200 ];
201 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
202 }
203 return Civi::$statics[__CLASS__]['fields'];
204 }
205
206 /**
207 * Return a mapping from field-name to the corresponding key (as used in fields()).
208 *
209 * @return array
210 * Array(string $name => string $uniqueName).
211 */
212 public static function &fieldKeys() {
213 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
214 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
215 }
216 return Civi::$statics[__CLASS__]['fieldKeys'];
217 }
218
219 /**
220 * Returns the names of this table
221 *
222 * @return string
223 */
224 public static function getTableName() {
225 return self::$_tableName;
226 }
227
228 /**
229 * Returns if this table needs to be logged
230 *
231 * @return bool
232 */
233 public function getLog() {
234 return self::$_log;
235 }
236
237 /**
238 * Returns the list of fields that can be imported
239 *
240 * @param bool $prefix
241 *
242 * @return array
243 */
244 public static function &import($prefix = FALSE) {
245 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'uf_match', $prefix, []);
246 return $r;
247 }
248
249 /**
250 * Returns the list of fields that can be exported
251 *
252 * @param bool $prefix
253 *
254 * @return array
255 */
256 public static function &export($prefix = FALSE) {
257 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'uf_match', $prefix, []);
258 return $r;
259 }
260
261 /**
262 * Returns the list of indices
263 *
264 * @param bool $localize
265 *
266 * @return array
267 */
268 public static function indices($localize = TRUE) {
269 $indices = [
270 'I_civicrm_uf_match_uf_id' => [
271 'name' => 'I_civicrm_uf_match_uf_id',
272 'field' => [
273 0 => 'uf_id',
274 ],
275 'localizable' => FALSE,
276 'sig' => 'civicrm_uf_match::0::uf_id',
277 ],
278 'UI_uf_name_domain_id' => [
279 'name' => 'UI_uf_name_domain_id',
280 'field' => [
281 0 => 'uf_name',
282 1 => 'domain_id',
283 ],
284 'localizable' => FALSE,
285 'unique' => TRUE,
286 'sig' => 'civicrm_uf_match::1::uf_name::domain_id',
287 ],
288 'UI_contact_domain_id' => [
289 'name' => 'UI_contact_domain_id',
290 'field' => [
291 0 => 'contact_id',
292 1 => 'domain_id',
293 ],
294 'localizable' => FALSE,
295 'unique' => TRUE,
296 'sig' => 'civicrm_uf_match::1::contact_id::domain_id',
297 ],
298 ];
299 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
300 }
301
302 }