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:c192c2dfffc598c44141e666fb164342)
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',
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'),
140 'where' => 'civicrm_uf_match.domain_id',
141 'table_name' => 'civicrm_uf_match',
142 'entity' => 'UFMatch',
143 'bao' => 'CRM_Core_BAO_UFMatch',
145 'FKClassName' => 'CRM_Core_DAO_Domain',
147 'label' => ts("Domain"),
149 'pseudoconstant' => [
150 'table' => 'civicrm_domain',
152 'labelColumn' => 'name',
158 'type' => CRM_Utils_Type
::T_INT
,
159 'title' => ts('CMS ID'),
160 'description' => ts('UF ID'),
162 'where' => 'civicrm_uf_match.uf_id',
163 'table_name' => 'civicrm_uf_match',
164 'entity' => 'UFMatch',
165 'bao' => 'CRM_Core_BAO_UFMatch',
171 'type' => CRM_Utils_Type
::T_STRING
,
172 'title' => ts('CMS Unique Identifier'),
173 'description' => ts('UF Name'),
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',
181 'add' => '1.9.kabissa',
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',
193 'FKClassName' => 'CRM_Contact_DAO_Contact',
195 'label' => ts("Contact"),
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'),
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',
214 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
216 return Civi
::$statics[__CLASS__
]['fields'];
220 * Return a mapping from field-name to the corresponding key (as used in fields()).
223 * Array(string $name => string $uniqueName).
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()));
229 return Civi
::$statics[__CLASS__
]['fieldKeys'];
233 * Returns the names of this table
237 public static function getTableName() {
238 return self
::$_tableName;
242 * Returns if this table needs to be logged
246 public function getLog() {
251 * Returns the list of fields that can be imported
253 * @param bool $prefix
257 public static function &import($prefix = FALSE) {
258 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'uf_match', $prefix, []);
263 * Returns the list of fields that can be exported
265 * @param bool $prefix
269 public static function &export($prefix = FALSE) {
270 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'uf_match', $prefix, []);
275 * Returns the list of indices
277 * @param bool $localize
281 public static function indices($localize = TRUE) {
283 'I_civicrm_uf_match_uf_id' => [
284 'name' => 'I_civicrm_uf_match_uf_id',
288 'localizable' => FALSE,
289 'sig' => 'civicrm_uf_match::0::uf_id',
291 'UI_uf_name_domain_id' => [
292 'name' => 'UI_uf_name_domain_id',
297 'localizable' => FALSE,
299 'sig' => 'civicrm_uf_match::1::uf_name::domain_id',
301 'UI_contact_domain_id' => [
302 'name' => 'UI_contact_domain_id',
307 'localizable' => FALSE,
309 'sig' => 'civicrm_uf_match::1::contact_id::domain_id',
312 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;