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