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