5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/UFMatch.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:b7305bf7df97967d214db393a34f740f)
13 * Database access object for the UFMatch entity.
15 class CRM_Core_DAO_UFMatch
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_uf_match';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
32 * System generated ID.
39 * Which Domain is this match entry for
67 * UI language preferred by the given user/contact
76 public function __construct() {
77 $this->__table
= 'civicrm_uf_match';
78 parent
::__construct();
82 * Returns foreign keys and entity references.
85 * [CRM_Core_Reference_Interface]
87 public static function getReferenceColumns() {
88 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
89 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
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');
92 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
94 return Civi
::$statics[__CLASS__
]['links'];
98 * Returns all the column names of this table
102 public static function &fields() {
103 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
104 Civi
::$statics[__CLASS__
]['fields'] = [
107 'type' => CRM_Utils_Type
::T_INT
,
108 'title' => ts('UF Match ID'),
109 'description' => ts('System generated ID.'),
111 'where' => 'civicrm_uf_match.id',
112 'table_name' => 'civicrm_uf_match',
113 'entity' => 'UFMatch',
114 'bao' => 'CRM_Core_BAO_UFMatch',
118 'name' => 'domain_id',
119 'type' => CRM_Utils_Type
::T_INT
,
120 'title' => ts('UF Match Domain ID'),
121 'description' => ts('Which Domain is this match entry for'),
123 'where' => 'civicrm_uf_match.domain_id',
124 'table_name' => 'civicrm_uf_match',
125 'entity' => 'UFMatch',
126 'bao' => 'CRM_Core_BAO_UFMatch',
128 'FKClassName' => 'CRM_Core_DAO_Domain',
129 'pseudoconstant' => [
130 'table' => 'civicrm_domain',
132 'labelColumn' => 'name',
137 'type' => CRM_Utils_Type
::T_INT
,
138 'title' => ts('CMS ID'),
139 'description' => ts('UF ID'),
141 'where' => 'civicrm_uf_match.uf_id',
142 'table_name' => 'civicrm_uf_match',
143 'entity' => 'UFMatch',
144 'bao' => 'CRM_Core_BAO_UFMatch',
149 'type' => CRM_Utils_Type
::T_STRING
,
150 'title' => ts('CMS Unique Identifier'),
151 'description' => ts('UF Name'),
153 'size' => CRM_Utils_Type
::HUGE
,
154 'where' => 'civicrm_uf_match.uf_name',
155 'table_name' => 'civicrm_uf_match',
156 'entity' => 'UFMatch',
157 'bao' => 'CRM_Core_BAO_UFMatch',
161 'name' => 'contact_id',
162 'type' => CRM_Utils_Type
::T_INT
,
163 'title' => ts('CiviCRM Contact ID'),
164 'description' => ts('FK to Contact ID'),
165 'where' => 'civicrm_uf_match.contact_id',
166 'table_name' => 'civicrm_uf_match',
167 'entity' => 'UFMatch',
168 'bao' => 'CRM_Core_BAO_UFMatch',
170 'FKClassName' => 'CRM_Contact_DAO_Contact',
173 'name' => 'language',
174 'type' => CRM_Utils_Type
::T_STRING
,
175 'title' => ts('Preferred Language'),
176 'description' => ts('UI language preferred by the given user/contact'),
178 'size' => CRM_Utils_Type
::SIX
,
179 'where' => 'civicrm_uf_match.language',
180 'table_name' => 'civicrm_uf_match',
181 'entity' => 'UFMatch',
182 'bao' => 'CRM_Core_BAO_UFMatch',
186 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
188 return Civi
::$statics[__CLASS__
]['fields'];
192 * Return a mapping from field-name to the corresponding key (as used in fields()).
195 * Array(string $name => string $uniqueName).
197 public static function &fieldKeys() {
198 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
199 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
201 return Civi
::$statics[__CLASS__
]['fieldKeys'];
205 * Returns the names of this table
209 public static function getTableName() {
210 return self
::$_tableName;
214 * Returns if this table needs to be logged
218 public function getLog() {
223 * Returns the list of fields that can be imported
225 * @param bool $prefix
229 public static function &import($prefix = FALSE) {
230 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'uf_match', $prefix, []);
235 * Returns the list of fields that can be exported
237 * @param bool $prefix
241 public static function &export($prefix = FALSE) {
242 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'uf_match', $prefix, []);
247 * Returns the list of indices
249 * @param bool $localize
253 public static function indices($localize = TRUE) {
255 'I_civicrm_uf_match_uf_id' => [
256 'name' => 'I_civicrm_uf_match_uf_id',
260 'localizable' => FALSE,
261 'sig' => 'civicrm_uf_match::0::uf_id',
263 'UI_uf_name_domain_id' => [
264 'name' => 'UI_uf_name_domain_id',
269 'localizable' => FALSE,
271 'sig' => 'civicrm_uf_match::1::uf_name::domain_id',
273 'UI_contact_domain_id' => [
274 'name' => 'UI_contact_domain_id',
279 'localizable' => FALSE,
281 'sig' => 'civicrm_uf_match::1::contact_id::domain_id',
284 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;