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:ad3e1eb59e96ed7553d2a3f48430c934)
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',
149 'name' => 'is_active',
150 'type' => CRM_Utils_Type
::T_BOOLEAN
,
151 'title' => ts('Profile Use is active'),
152 'description' => ts('Is this join currently active?'),
153 'where' => 'civicrm_uf_join.is_active',
155 'table_name' => 'civicrm_uf_join',
156 'entity' => 'UFJoin',
157 'bao' => 'CRM_Core_BAO_UFJoin',
163 'type' => CRM_Utils_Type
::T_STRING
,
164 'title' => ts('Profile Module'),
165 'description' => ts('Module which owns this uf_join instance, e.g. User Registration, CiviDonate, etc.'),
168 'size' => CRM_Utils_Type
::BIG
,
169 'where' => 'civicrm_uf_join.module',
170 'table_name' => 'civicrm_uf_join',
171 'entity' => 'UFJoin',
172 'bao' => 'CRM_Core_BAO_UFJoin',
177 'name' => 'entity_table',
178 'type' => CRM_Utils_Type
::T_STRING
,
179 'title' => ts('Profile Entity Table'),
180 '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.'),
182 'size' => CRM_Utils_Type
::BIG
,
183 'where' => 'civicrm_uf_join.entity_table',
184 'table_name' => 'civicrm_uf_join',
185 'entity' => 'UFJoin',
186 'bao' => 'CRM_Core_BAO_UFJoin',
188 'pseudoconstant' => [
189 'callback' => 'CRM_Core_BAO_UFJoin::entityTables',
194 'name' => 'entity_id',
195 'type' => CRM_Utils_Type
::T_INT
,
196 'title' => ts('Profile Entity ID'),
197 'description' => ts('Foreign key to the referenced item.'),
198 'where' => 'civicrm_uf_join.entity_id',
199 'table_name' => 'civicrm_uf_join',
200 'entity' => 'UFJoin',
201 'bao' => 'CRM_Core_BAO_UFJoin',
207 'type' => CRM_Utils_Type
::T_INT
,
208 'title' => ts('Order'),
209 'description' => ts('Controls display order when multiple user framework groups are setup for concurrent display.'),
211 'where' => 'civicrm_uf_join.weight',
213 'table_name' => 'civicrm_uf_join',
214 'entity' => 'UFJoin',
215 'bao' => 'CRM_Core_BAO_UFJoin',
220 'name' => 'uf_group_id',
221 'type' => CRM_Utils_Type
::T_INT
,
222 'title' => ts('Profile ID'),
223 'description' => ts('Which form does this field belong to.'),
225 'where' => 'civicrm_uf_join.uf_group_id',
226 'table_name' => 'civicrm_uf_join',
227 'entity' => 'UFJoin',
228 'bao' => 'CRM_Core_BAO_UFJoin',
230 'FKClassName' => 'CRM_Core_DAO_UFGroup',
233 'label' => ts("Profile"),
235 'pseudoconstant' => [
236 'table' => 'civicrm_uf_group',
238 'labelColumn' => 'title',
243 'name' => 'module_data',
244 'type' => CRM_Utils_Type
::T_LONGTEXT
,
245 'title' => ts('Profile Use Data'),
246 'description' => ts('Json serialized array of data used by the ufjoin.module'),
247 'where' => 'civicrm_uf_join.module_data',
248 'table_name' => 'civicrm_uf_join',
249 'entity' => 'UFJoin',
250 'bao' => 'CRM_Core_BAO_UFJoin',
252 'serialize' => self
::SERIALIZE_JSON
,
256 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
258 return Civi
::$statics[__CLASS__
]['fields'];
262 * Return a mapping from field-name to the corresponding key (as used in fields()).
265 * Array(string $name => string $uniqueName).
267 public static function &fieldKeys() {
268 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
269 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
271 return Civi
::$statics[__CLASS__
]['fieldKeys'];
275 * Returns the names of this table
279 public static function getTableName() {
280 return self
::$_tableName;
284 * Returns if this table needs to be logged
288 public function getLog() {
293 * Returns the list of fields that can be imported
295 * @param bool $prefix
299 public static function &import($prefix = FALSE) {
300 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'uf_join', $prefix, []);
305 * Returns the list of fields that can be exported
307 * @param bool $prefix
311 public static function &export($prefix = FALSE) {
312 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'uf_join', $prefix, []);
317 * Returns the list of indices
319 * @param bool $localize
323 public static function indices($localize = TRUE) {
326 'name' => 'index_entity',
331 'localizable' => FALSE,
332 'sig' => 'civicrm_uf_join::0::entity_table::entity_id',
335 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;