Merge pull request #20505 from JMAConsulting/contribution_product_api4
[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:c192c2dfffc598c44141e666fb164342)
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 * @param bool $plural
87 * Whether to return the plural version of the title.
88 */
89 public static function getEntityTitle($plural = FALSE) {
90 return $plural ? ts('UFMatches') : ts('UFMatch');
91 }
92
93 /**
94 * Returns foreign keys and entity references.
95 *
96 * @return array
97 * [CRM_Core_Reference_Interface]
98 */
99 public static function getReferenceColumns() {
100 if (!isset(Civi::$statics[__CLASS__]['links'])) {
101 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
102 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id');
103 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contact_id', 'civicrm_contact', 'id');
104 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
105 }
106 return Civi::$statics[__CLASS__]['links'];
107 }
108
109 /**
110 * Returns all the column names of this table
111 *
112 * @return array
113 */
114 public static function &fields() {
115 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
116 Civi::$statics[__CLASS__]['fields'] = [
117 'id' => [
118 'name' => 'id',
119 'type' => CRM_Utils_Type::T_INT,
120 'title' => ts('UF Match ID'),
121 'description' => ts('System generated ID.'),
122 'required' => TRUE,
123 'where' => 'civicrm_uf_match.id',
124 'table_name' => 'civicrm_uf_match',
125 'entity' => 'UFMatch',
126 'bao' => 'CRM_Core_BAO_UFMatch',
127 'localizable' => 0,
128 'html' => [
129 'type' => 'Number',
130 ],
131 'readonly' => TRUE,
132 'add' => '1.1',
133 ],
134 'domain_id' => [
135 'name' => 'domain_id',
136 'type' => CRM_Utils_Type::T_INT,
137 'title' => ts('Domain ID'),
138 'description' => ts('Which Domain is this match entry for'),
139 'required' => TRUE,
140 'where' => 'civicrm_uf_match.domain_id',
141 'table_name' => 'civicrm_uf_match',
142 'entity' => 'UFMatch',
143 'bao' => 'CRM_Core_BAO_UFMatch',
144 'localizable' => 0,
145 'FKClassName' => 'CRM_Core_DAO_Domain',
146 'html' => [
147 'label' => ts("Domain"),
148 ],
149 'pseudoconstant' => [
150 'table' => 'civicrm_domain',
151 'keyColumn' => 'id',
152 'labelColumn' => 'name',
153 ],
154 'add' => '3.0',
155 ],
156 'uf_id' => [
157 'name' => 'uf_id',
158 'type' => CRM_Utils_Type::T_INT,
159 'title' => ts('CMS ID'),
160 'description' => ts('UF ID'),
161 'required' => TRUE,
162 'where' => 'civicrm_uf_match.uf_id',
163 'table_name' => 'civicrm_uf_match',
164 'entity' => 'UFMatch',
165 'bao' => 'CRM_Core_BAO_UFMatch',
166 'localizable' => 0,
167 'add' => '1.1',
168 ],
169 'uf_name' => [
170 'name' => 'uf_name',
171 'type' => CRM_Utils_Type::T_STRING,
172 'title' => ts('CMS Unique Identifier'),
173 'description' => ts('UF Name'),
174 'maxlength' => 128,
175 'size' => CRM_Utils_Type::HUGE,
176 'where' => 'civicrm_uf_match.uf_name',
177 'table_name' => 'civicrm_uf_match',
178 'entity' => 'UFMatch',
179 'bao' => 'CRM_Core_BAO_UFMatch',
180 'localizable' => 0,
181 'add' => '1.9.kabissa',
182 ],
183 'contact_id' => [
184 'name' => 'contact_id',
185 'type' => CRM_Utils_Type::T_INT,
186 'title' => ts('Contact ID'),
187 'description' => ts('FK to Contact ID'),
188 'where' => 'civicrm_uf_match.contact_id',
189 'table_name' => 'civicrm_uf_match',
190 'entity' => 'UFMatch',
191 'bao' => 'CRM_Core_BAO_UFMatch',
192 'localizable' => 0,
193 'FKClassName' => 'CRM_Contact_DAO_Contact',
194 'html' => [
195 'label' => ts("Contact"),
196 ],
197 'add' => '1.1',
198 ],
199 'language' => [
200 'name' => 'language',
201 'type' => CRM_Utils_Type::T_STRING,
202 'title' => ts('Preferred Language'),
203 'description' => ts('UI language preferred by the given user/contact'),
204 'maxlength' => 5,
205 'size' => CRM_Utils_Type::SIX,
206 'where' => 'civicrm_uf_match.language',
207 'table_name' => 'civicrm_uf_match',
208 'entity' => 'UFMatch',
209 'bao' => 'CRM_Core_BAO_UFMatch',
210 'localizable' => 0,
211 'add' => '2.1',
212 ],
213 ];
214 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
215 }
216 return Civi::$statics[__CLASS__]['fields'];
217 }
218
219 /**
220 * Return a mapping from field-name to the corresponding key (as used in fields()).
221 *
222 * @return array
223 * Array(string $name => string $uniqueName).
224 */
225 public static function &fieldKeys() {
226 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
227 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
228 }
229 return Civi::$statics[__CLASS__]['fieldKeys'];
230 }
231
232 /**
233 * Returns the names of this table
234 *
235 * @return string
236 */
237 public static function getTableName() {
238 return self::$_tableName;
239 }
240
241 /**
242 * Returns if this table needs to be logged
243 *
244 * @return bool
245 */
246 public function getLog() {
247 return self::$_log;
248 }
249
250 /**
251 * Returns the list of fields that can be imported
252 *
253 * @param bool $prefix
254 *
255 * @return array
256 */
257 public static function &import($prefix = FALSE) {
258 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'uf_match', $prefix, []);
259 return $r;
260 }
261
262 /**
263 * Returns the list of fields that can be exported
264 *
265 * @param bool $prefix
266 *
267 * @return array
268 */
269 public static function &export($prefix = FALSE) {
270 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'uf_match', $prefix, []);
271 return $r;
272 }
273
274 /**
275 * Returns the list of indices
276 *
277 * @param bool $localize
278 *
279 * @return array
280 */
281 public static function indices($localize = TRUE) {
282 $indices = [
283 'I_civicrm_uf_match_uf_id' => [
284 'name' => 'I_civicrm_uf_match_uf_id',
285 'field' => [
286 0 => 'uf_id',
287 ],
288 'localizable' => FALSE,
289 'sig' => 'civicrm_uf_match::0::uf_id',
290 ],
291 'UI_uf_name_domain_id' => [
292 'name' => 'UI_uf_name_domain_id',
293 'field' => [
294 0 => 'uf_name',
295 1 => 'domain_id',
296 ],
297 'localizable' => FALSE,
298 'unique' => TRUE,
299 'sig' => 'civicrm_uf_match::1::uf_name::domain_id',
300 ],
301 'UI_contact_domain_id' => [
302 'name' => 'UI_contact_domain_id',
303 'field' => [
304 0 => 'contact_id',
305 1 => 'domain_id',
306 ],
307 'localizable' => FALSE,
308 'unique' => TRUE,
309 'sig' => 'civicrm_uf_match::1::contact_id::domain_id',
310 ],
311 ];
312 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
313 }
314
315 }