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:191143bced279d48cf34cdf6cf85a5fb)
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 public static function getEntityTitle() {
101 return ts('UFJoins');
105 * Returns foreign keys and entity references.
108 * [CRM_Core_Reference_Interface]
110 public static function getReferenceColumns() {
111 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
112 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
113 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'uf_group_id', 'civicrm_uf_group', 'id');
114 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
115 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
117 return Civi
::$statics[__CLASS__
]['links'];
121 * Returns all the column names of this table
125 public static function &fields() {
126 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
127 Civi
::$statics[__CLASS__
]['fields'] = [
130 'type' => CRM_Utils_Type
::T_INT
,
131 'title' => ts('UF Join ID'),
132 'description' => ts('Unique table ID'),
134 'where' => 'civicrm_uf_join.id',
135 'table_name' => 'civicrm_uf_join',
136 'entity' => 'UFJoin',
137 'bao' => 'CRM_Core_BAO_UFJoin',
142 'name' => 'is_active',
143 'type' => CRM_Utils_Type
::T_BOOLEAN
,
144 'title' => ts('Profile Use is active'),
145 'description' => ts('Is this join currently active?'),
146 'where' => 'civicrm_uf_join.is_active',
148 'table_name' => 'civicrm_uf_join',
149 'entity' => 'UFJoin',
150 'bao' => 'CRM_Core_BAO_UFJoin',
156 'type' => CRM_Utils_Type
::T_STRING
,
157 'title' => ts('Profile Module'),
158 'description' => ts('Module which owns this uf_join instance, e.g. User Registration, CiviDonate, etc.'),
161 'size' => CRM_Utils_Type
::BIG
,
162 'where' => 'civicrm_uf_join.module',
163 'table_name' => 'civicrm_uf_join',
164 'entity' => 'UFJoin',
165 'bao' => 'CRM_Core_BAO_UFJoin',
170 'name' => 'entity_table',
171 'type' => CRM_Utils_Type
::T_STRING
,
172 'title' => ts('Profile Entity Table'),
173 '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.'),
175 'size' => CRM_Utils_Type
::BIG
,
176 'where' => 'civicrm_uf_join.entity_table',
177 'table_name' => 'civicrm_uf_join',
178 'entity' => 'UFJoin',
179 'bao' => 'CRM_Core_BAO_UFJoin',
181 'pseudoconstant' => [
182 'callback' => 'CRM_Core_BAO_UFJoin::entityTables',
187 'name' => 'entity_id',
188 'type' => CRM_Utils_Type
::T_INT
,
189 'title' => ts('Profile Entity ID'),
190 'description' => ts('Foreign key to the referenced item.'),
191 'where' => 'civicrm_uf_join.entity_id',
192 'table_name' => 'civicrm_uf_join',
193 'entity' => 'UFJoin',
194 'bao' => 'CRM_Core_BAO_UFJoin',
200 'type' => CRM_Utils_Type
::T_INT
,
201 'title' => ts('Order'),
202 'description' => ts('Controls display order when multiple user framework groups are setup for concurrent display.'),
204 'where' => 'civicrm_uf_join.weight',
206 'table_name' => 'civicrm_uf_join',
207 'entity' => 'UFJoin',
208 'bao' => 'CRM_Core_BAO_UFJoin',
213 'name' => 'uf_group_id',
214 'type' => CRM_Utils_Type
::T_INT
,
215 'title' => ts('Profile ID'),
216 'description' => ts('Which form does this field belong to.'),
218 'where' => 'civicrm_uf_join.uf_group_id',
219 'table_name' => 'civicrm_uf_join',
220 'entity' => 'UFJoin',
221 'bao' => 'CRM_Core_BAO_UFJoin',
223 'FKClassName' => 'CRM_Core_DAO_UFGroup',
227 'pseudoconstant' => [
228 'table' => 'civicrm_uf_group',
230 'labelColumn' => 'title',
235 'name' => 'module_data',
236 'type' => CRM_Utils_Type
::T_LONGTEXT
,
237 'title' => ts('Profile Use Data'),
238 'description' => ts('Json serialized array of data used by the ufjoin.module'),
239 'where' => 'civicrm_uf_join.module_data',
240 'table_name' => 'civicrm_uf_join',
241 'entity' => 'UFJoin',
242 'bao' => 'CRM_Core_BAO_UFJoin',
244 'serialize' => self
::SERIALIZE_JSON
,
248 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
250 return Civi
::$statics[__CLASS__
]['fields'];
254 * Return a mapping from field-name to the corresponding key (as used in fields()).
257 * Array(string $name => string $uniqueName).
259 public static function &fieldKeys() {
260 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
261 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
263 return Civi
::$statics[__CLASS__
]['fieldKeys'];
267 * Returns the names of this table
271 public static function getTableName() {
272 return self
::$_tableName;
276 * Returns if this table needs to be logged
280 public function getLog() {
285 * Returns the list of fields that can be imported
287 * @param bool $prefix
291 public static function &import($prefix = FALSE) {
292 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'uf_join', $prefix, []);
297 * Returns the list of fields that can be exported
299 * @param bool $prefix
303 public static function &export($prefix = FALSE) {
304 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'uf_join', $prefix, []);
309 * Returns the list of indices
311 * @param bool $localize
315 public static function indices($localize = TRUE) {
318 'name' => 'index_entity',
323 'localizable' => FALSE,
324 'sig' => 'civicrm_uf_join::0::entity_table::entity_id',
327 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;