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