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