5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/UFJoin.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:4bcf2b3e5905f98d83d449b1226903da)
13 * Database access object for the UFJoin entity.
15 class CRM_Core_DAO_UFJoin
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.3';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_uf_join';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = TRUE;
41 * Is this join currently active?
48 * Module which owns this uf_join instance, e.g. User Registration, CiviDonate, etc.
55 * Name of table where item being referenced is stored. Modules which only need a single collection of uf_join instances may choose not to populate entity_table and entity_id.
62 * Foreign key to the referenced item.
69 * Controls display order when multiple user framework groups are setup for concurrent display.
76 * Which form does this field belong to.
83 * Json serialized array of data used by the ufjoin.module
92 public function __construct() {
93 $this->__table
= 'civicrm_uf_join';
94 parent
::__construct();
98 * Returns localized title of this entity.
100 * @param bool $plural
101 * Whether to return the plural version of the title.
103 public static function getEntityTitle($plural = FALSE) {
104 return $plural ?
ts('UFJoins') : ts('UFJoin');
108 * Returns foreign keys and entity references.
111 * [CRM_Core_Reference_Interface]
113 public static function getReferenceColumns() {
114 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
115 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
116 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'uf_group_id', 'civicrm_uf_group', 'id');
117 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
118 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
120 return Civi
::$statics[__CLASS__
]['links'];
124 * Returns all the column names of this table
128 public static function &fields() {
129 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
130 Civi
::$statics[__CLASS__
]['fields'] = [
133 'type' => CRM_Utils_Type
::T_INT
,
134 'title' => ts('UF Join ID'),
135 'description' => ts('Unique table ID'),
137 'where' => 'civicrm_uf_join.id',
138 'table_name' => 'civicrm_uf_join',
139 'entity' => 'UFJoin',
140 'bao' => 'CRM_Core_BAO_UFJoin',
145 'name' => 'is_active',
146 'type' => CRM_Utils_Type
::T_BOOLEAN
,
147 'title' => ts('Profile Use is active'),
148 'description' => ts('Is this join currently active?'),
149 'where' => 'civicrm_uf_join.is_active',
151 'table_name' => 'civicrm_uf_join',
152 'entity' => 'UFJoin',
153 'bao' => 'CRM_Core_BAO_UFJoin',
159 'type' => CRM_Utils_Type
::T_STRING
,
160 'title' => ts('Profile Module'),
161 'description' => ts('Module which owns this uf_join instance, e.g. User Registration, CiviDonate, etc.'),
164 'size' => CRM_Utils_Type
::BIG
,
165 'where' => 'civicrm_uf_join.module',
166 'table_name' => 'civicrm_uf_join',
167 'entity' => 'UFJoin',
168 'bao' => 'CRM_Core_BAO_UFJoin',
173 'name' => 'entity_table',
174 'type' => CRM_Utils_Type
::T_STRING
,
175 'title' => ts('Profile Entity Table'),
176 'description' => ts('Name of table where item being referenced is stored. Modules which only need a single collection of uf_join instances may choose not to populate entity_table and entity_id.'),
178 'size' => CRM_Utils_Type
::BIG
,
179 'where' => 'civicrm_uf_join.entity_table',
180 'table_name' => 'civicrm_uf_join',
181 'entity' => 'UFJoin',
182 'bao' => 'CRM_Core_BAO_UFJoin',
184 'pseudoconstant' => [
185 'callback' => 'CRM_Core_BAO_UFJoin::entityTables',
190 'name' => 'entity_id',
191 'type' => CRM_Utils_Type
::T_INT
,
192 'title' => ts('Profile Entity ID'),
193 'description' => ts('Foreign key to the referenced item.'),
194 'where' => 'civicrm_uf_join.entity_id',
195 'table_name' => 'civicrm_uf_join',
196 'entity' => 'UFJoin',
197 'bao' => 'CRM_Core_BAO_UFJoin',
203 'type' => CRM_Utils_Type
::T_INT
,
204 'title' => ts('Order'),
205 'description' => ts('Controls display order when multiple user framework groups are setup for concurrent display.'),
207 'where' => 'civicrm_uf_join.weight',
209 'table_name' => 'civicrm_uf_join',
210 'entity' => 'UFJoin',
211 'bao' => 'CRM_Core_BAO_UFJoin',
216 'name' => 'uf_group_id',
217 'type' => CRM_Utils_Type
::T_INT
,
218 'title' => ts('Profile ID'),
219 'description' => ts('Which form does this field belong to.'),
221 'where' => 'civicrm_uf_join.uf_group_id',
222 'table_name' => 'civicrm_uf_join',
223 'entity' => 'UFJoin',
224 'bao' => 'CRM_Core_BAO_UFJoin',
226 'FKClassName' => 'CRM_Core_DAO_UFGroup',
230 'pseudoconstant' => [
231 'table' => 'civicrm_uf_group',
233 'labelColumn' => 'title',
238 'name' => 'module_data',
239 'type' => CRM_Utils_Type
::T_LONGTEXT
,
240 'title' => ts('Profile Use Data'),
241 'description' => ts('Json serialized array of data used by the ufjoin.module'),
242 'where' => 'civicrm_uf_join.module_data',
243 'table_name' => 'civicrm_uf_join',
244 'entity' => 'UFJoin',
245 'bao' => 'CRM_Core_BAO_UFJoin',
247 'serialize' => self
::SERIALIZE_JSON
,
251 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
253 return Civi
::$statics[__CLASS__
]['fields'];
257 * Return a mapping from field-name to the corresponding key (as used in fields()).
260 * Array(string $name => string $uniqueName).
262 public static function &fieldKeys() {
263 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
264 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
266 return Civi
::$statics[__CLASS__
]['fieldKeys'];
270 * Returns the names of this table
274 public static function getTableName() {
275 return self
::$_tableName;
279 * Returns if this table needs to be logged
283 public function getLog() {
288 * Returns the list of fields that can be imported
290 * @param bool $prefix
294 public static function &import($prefix = FALSE) {
295 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'uf_join', $prefix, []);
300 * Returns the list of fields that can be exported
302 * @param bool $prefix
306 public static function &export($prefix = FALSE) {
307 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'uf_join', $prefix, []);
312 * Returns the list of indices
314 * @param bool $localize
318 public static function indices($localize = TRUE) {
321 'name' => 'index_entity',
326 'localizable' => FALSE,
327 'sig' => 'civicrm_uf_join::0::entity_table::entity_id',
330 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;