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:613e38722266d0117e69f521e4f0d140)
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.
41 * Which Domain is this match entry for
69 * UI language preferred by the given user/contact
78 public function __construct() {
79 $this->__table
= 'civicrm_uf_match';
80 parent
::__construct();
84 * Returns localized title of this entity.
87 * Whether to return the plural version of the title.
89 public static function getEntityTitle($plural = FALSE) {
90 return $plural ?
ts('UFMatches') : ts('UFMatch');
94 * Returns foreign keys and entity references.
97 * [CRM_Core_Reference_Interface]
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']);
106 return Civi
::$statics[__CLASS__
]['links'];
110 * Returns all the column names of this table
114 public static function &fields() {
115 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
116 Civi
::$statics[__CLASS__
]['fields'] = [
119 'type' => CRM_Utils_Type
::T_INT
,
120 'title' => ts('UF Match ID'),
121 'description' => ts('System generated ID.'),
123 'where' => 'civicrm_uf_match.id',
124 'table_name' => 'civicrm_uf_match',
125 'entity' => 'UFMatch',
126 'bao' => 'CRM_Core_BAO_UFMatch',
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'),
136 'where' => 'civicrm_uf_match.domain_id',
137 'table_name' => 'civicrm_uf_match',
138 'entity' => 'UFMatch',
139 'bao' => 'CRM_Core_BAO_UFMatch',
141 'FKClassName' => 'CRM_Core_DAO_Domain',
142 'pseudoconstant' => [
143 'table' => 'civicrm_domain',
145 'labelColumn' => 'name',
151 'type' => CRM_Utils_Type
::T_INT
,
152 'title' => ts('CMS ID'),
153 'description' => ts('UF ID'),
155 'where' => 'civicrm_uf_match.uf_id',
156 'table_name' => 'civicrm_uf_match',
157 'entity' => 'UFMatch',
158 'bao' => 'CRM_Core_BAO_UFMatch',
164 'type' => CRM_Utils_Type
::T_STRING
,
165 'title' => ts('CMS Unique Identifier'),
166 'description' => ts('UF Name'),
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',
174 'add' => '1.9.kabissa',
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',
186 'FKClassName' => 'CRM_Contact_DAO_Contact',
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'),
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',
204 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
206 return Civi
::$statics[__CLASS__
]['fields'];
210 * Return a mapping from field-name to the corresponding key (as used in fields()).
213 * Array(string $name => string $uniqueName).
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()));
219 return Civi
::$statics[__CLASS__
]['fieldKeys'];
223 * Returns the names of this table
227 public static function getTableName() {
228 return self
::$_tableName;
232 * Returns if this table needs to be logged
236 public function getLog() {
241 * Returns the list of fields that can be imported
243 * @param bool $prefix
247 public static function &import($prefix = FALSE) {
248 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'uf_match', $prefix, []);
253 * Returns the list of fields that can be exported
255 * @param bool $prefix
259 public static function &export($prefix = FALSE) {
260 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'uf_match', $prefix, []);
265 * Returns the list of indices
267 * @param bool $localize
271 public static function indices($localize = TRUE) {
273 'I_civicrm_uf_match_uf_id' => [
274 'name' => 'I_civicrm_uf_match_uf_id',
278 'localizable' => FALSE,
279 'sig' => 'civicrm_uf_match::0::uf_id',
281 'UI_uf_name_domain_id' => [
282 'name' => 'UI_uf_name_domain_id',
287 'localizable' => FALSE,
289 'sig' => 'civicrm_uf_match::1::uf_name::domain_id',
291 'UI_contact_domain_id' => [
292 'name' => 'UI_contact_domain_id',
297 'localizable' => FALSE,
299 'sig' => 'civicrm_uf_match::1::contact_id::domain_id',
302 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;