5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/UFMatch.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:bb9d91c913ff3b1088ca8fa03cd23740)
13 * Database access object for the UFMatch entity.
15 class CRM_Core_DAO_UFMatch
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.1';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_uf_match';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = TRUE;
34 * System generated ID.
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
43 * Which Domain is this match entry for
46 * (SQL type: int unsigned)
47 * Note that values will be retrieved from the database as a string.
55 * (SQL type: int unsigned)
56 * Note that values will be retrieved from the database as a string.
64 * (SQL type: varchar(128))
65 * Note that values will be retrieved from the database as a string.
72 * @var int|string|null
73 * (SQL type: int unsigned)
74 * Note that values will be retrieved from the database as a string.
79 * UI language preferred by the given user/contact
82 * (SQL type: varchar(5))
83 * Note that values will be retrieved from the database as a string.
90 public function __construct() {
91 $this->__table
= 'civicrm_uf_match';
92 parent
::__construct();
96 * Returns localized title of this entity.
99 * Whether to return the plural version of the title.
101 public static function getEntityTitle($plural = FALSE) {
102 return $plural ?
ts('UFMatches') : ts('UFMatch');
106 * Returns foreign keys and entity references.
109 * [CRM_Core_Reference_Interface]
111 public static function getReferenceColumns() {
112 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
113 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
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');
116 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
118 return Civi
::$statics[__CLASS__
]['links'];
122 * Returns all the column names of this table
126 public static function &fields() {
127 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
128 Civi
::$statics[__CLASS__
]['fields'] = [
131 'type' => CRM_Utils_Type
::T_INT
,
132 'title' => ts('UF Match ID'),
133 'description' => ts('System generated ID.'),
135 'where' => 'civicrm_uf_match.id',
136 'table_name' => 'civicrm_uf_match',
137 'entity' => 'UFMatch',
138 'bao' => 'CRM_Core_BAO_UFMatch',
147 'name' => 'domain_id',
148 'type' => CRM_Utils_Type
::T_INT
,
149 'title' => ts('Domain ID'),
150 'description' => ts('Which Domain is this match entry for'),
152 'where' => 'civicrm_uf_match.domain_id',
153 'table_name' => 'civicrm_uf_match',
154 'entity' => 'UFMatch',
155 'bao' => 'CRM_Core_BAO_UFMatch',
157 'FKClassName' => 'CRM_Core_DAO_Domain',
159 'label' => ts("Domain"),
161 'pseudoconstant' => [
162 'table' => 'civicrm_domain',
164 'labelColumn' => 'name',
170 'type' => CRM_Utils_Type
::T_INT
,
171 'title' => ts('CMS ID'),
172 'description' => ts('UF ID'),
174 'where' => 'civicrm_uf_match.uf_id',
175 'table_name' => 'civicrm_uf_match',
176 'entity' => 'UFMatch',
177 'bao' => 'CRM_Core_BAO_UFMatch',
183 'type' => CRM_Utils_Type
::T_STRING
,
184 'title' => ts('CMS Unique Identifier'),
185 'description' => ts('UF Name'),
187 'size' => CRM_Utils_Type
::HUGE
,
188 'where' => 'civicrm_uf_match.uf_name',
189 'table_name' => 'civicrm_uf_match',
190 'entity' => 'UFMatch',
191 'bao' => 'CRM_Core_BAO_UFMatch',
193 'add' => '1.9.kabissa',
196 'name' => 'contact_id',
197 'type' => CRM_Utils_Type
::T_INT
,
198 'title' => ts('Contact ID'),
199 'description' => ts('FK to Contact ID'),
200 'where' => 'civicrm_uf_match.contact_id',
201 'table_name' => 'civicrm_uf_match',
202 'entity' => 'UFMatch',
203 'bao' => 'CRM_Core_BAO_UFMatch',
205 'FKClassName' => 'CRM_Contact_DAO_Contact',
207 'label' => ts("Contact"),
212 'name' => 'language',
213 'type' => CRM_Utils_Type
::T_STRING
,
214 'title' => ts('Preferred Language'),
215 'description' => ts('UI language preferred by the given user/contact'),
217 'size' => CRM_Utils_Type
::SIX
,
218 'where' => 'civicrm_uf_match.language',
219 'table_name' => 'civicrm_uf_match',
220 'entity' => 'UFMatch',
221 'bao' => 'CRM_Core_BAO_UFMatch',
226 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
228 return Civi
::$statics[__CLASS__
]['fields'];
232 * Return a mapping from field-name to the corresponding key (as used in fields()).
235 * Array(string $name => string $uniqueName).
237 public static function &fieldKeys() {
238 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
239 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
241 return Civi
::$statics[__CLASS__
]['fieldKeys'];
245 * Returns the names of this table
249 public static function getTableName() {
250 return self
::$_tableName;
254 * Returns if this table needs to be logged
258 public function getLog() {
263 * Returns the list of fields that can be imported
265 * @param bool $prefix
269 public static function &import($prefix = FALSE) {
270 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'uf_match', $prefix, []);
275 * Returns the list of fields that can be exported
277 * @param bool $prefix
281 public static function &export($prefix = FALSE) {
282 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'uf_match', $prefix, []);
287 * Returns the list of indices
289 * @param bool $localize
293 public static function indices($localize = TRUE) {
295 'I_civicrm_uf_match_uf_id' => [
296 'name' => 'I_civicrm_uf_match_uf_id',
300 'localizable' => FALSE,
301 'sig' => 'civicrm_uf_match::0::uf_id',
303 'UI_uf_name_domain_id' => [
304 'name' => 'UI_uf_name_domain_id',
309 'localizable' => FALSE,
311 'sig' => 'civicrm_uf_match::1::uf_name::domain_id',
313 'UI_contact_domain_id' => [
314 'name' => 'UI_contact_domain_id',
319 'localizable' => FALSE,
321 'sig' => 'civicrm_uf_match::1::contact_id::domain_id',
324 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;