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:1e4fa645d4bface77a08688d714ba651)
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;
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
43 * Is this join currently active?
45 * @var bool|string|null
47 * Note that values will be retrieved from the database as a string.
52 * Module which owns this uf_join instance, e.g. User Registration, CiviDonate, etc.
55 * (SQL type: varchar(64))
56 * Note that values will be retrieved from the database as a string.
61 * 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.
64 * (SQL type: varchar(64))
65 * Note that values will be retrieved from the database as a string.
70 * Foreign key to the referenced item.
72 * @var int|string|null
73 * (SQL type: int unsigned)
74 * Note that values will be retrieved from the database as a string.
79 * Controls display order when multiple user framework groups are setup for concurrent display.
83 * Note that values will be retrieved from the database as a string.
88 * Which form does this field belong to.
91 * (SQL type: int unsigned)
92 * Note that values will be retrieved from the database as a string.
97 * Json serialized array of data used by the ufjoin.module
100 * (SQL type: longtext)
101 * Note that values will be retrieved from the database as a string.
108 public function __construct() {
109 $this->__table
= 'civicrm_uf_join';
110 parent
::__construct();
114 * Returns localized title of this entity.
116 * @param bool $plural
117 * Whether to return the plural version of the title.
119 public static function getEntityTitle($plural = FALSE) {
120 return $plural ?
ts('UFJoins') : ts('UFJoin');
124 * Returns foreign keys and entity references.
127 * [CRM_Core_Reference_Interface]
129 public static function getReferenceColumns() {
130 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
131 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
132 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'uf_group_id', 'civicrm_uf_group', 'id');
133 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
134 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
136 return Civi
::$statics[__CLASS__
]['links'];
140 * Returns all the column names of this table
144 public static function &fields() {
145 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
146 Civi
::$statics[__CLASS__
]['fields'] = [
149 'type' => CRM_Utils_Type
::T_INT
,
150 'title' => ts('UF Join ID'),
151 'description' => ts('Unique table ID'),
153 'where' => 'civicrm_uf_join.id',
154 'table_name' => 'civicrm_uf_join',
155 'entity' => 'UFJoin',
156 'bao' => 'CRM_Core_BAO_UFJoin',
165 'name' => 'is_active',
166 'type' => CRM_Utils_Type
::T_BOOLEAN
,
167 'title' => ts('Profile Use is active'),
168 'description' => ts('Is this join currently active?'),
169 'where' => 'civicrm_uf_join.is_active',
171 'table_name' => 'civicrm_uf_join',
172 'entity' => 'UFJoin',
173 'bao' => 'CRM_Core_BAO_UFJoin',
179 'type' => CRM_Utils_Type
::T_STRING
,
180 'title' => ts('Profile Module'),
181 'description' => ts('Module which owns this uf_join instance, e.g. User Registration, CiviDonate, etc.'),
184 'size' => CRM_Utils_Type
::BIG
,
185 'where' => 'civicrm_uf_join.module',
186 'table_name' => 'civicrm_uf_join',
187 'entity' => 'UFJoin',
188 'bao' => 'CRM_Core_BAO_UFJoin',
193 'name' => 'entity_table',
194 'type' => CRM_Utils_Type
::T_STRING
,
195 'title' => ts('Profile Entity Table'),
196 '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.'),
198 'size' => CRM_Utils_Type
::BIG
,
199 'where' => 'civicrm_uf_join.entity_table',
200 'table_name' => 'civicrm_uf_join',
201 'entity' => 'UFJoin',
202 'bao' => 'CRM_Core_BAO_UFJoin',
204 'pseudoconstant' => [
205 'callback' => 'CRM_Core_BAO_UFJoin::entityTables',
210 'name' => 'entity_id',
211 'type' => CRM_Utils_Type
::T_INT
,
212 'title' => ts('Profile Entity ID'),
213 'description' => ts('Foreign key to the referenced item.'),
214 'where' => 'civicrm_uf_join.entity_id',
215 'table_name' => 'civicrm_uf_join',
216 'entity' => 'UFJoin',
217 'bao' => 'CRM_Core_BAO_UFJoin',
223 'type' => CRM_Utils_Type
::T_INT
,
224 'title' => ts('Order'),
225 'description' => ts('Controls display order when multiple user framework groups are setup for concurrent display.'),
227 'where' => 'civicrm_uf_join.weight',
229 'table_name' => 'civicrm_uf_join',
230 'entity' => 'UFJoin',
231 'bao' => 'CRM_Core_BAO_UFJoin',
236 'name' => 'uf_group_id',
237 'type' => CRM_Utils_Type
::T_INT
,
238 'title' => ts('Profile ID'),
239 'description' => ts('Which form does this field belong to.'),
241 'where' => 'civicrm_uf_join.uf_group_id',
242 'table_name' => 'civicrm_uf_join',
243 'entity' => 'UFJoin',
244 'bao' => 'CRM_Core_BAO_UFJoin',
246 'FKClassName' => 'CRM_Core_DAO_UFGroup',
249 'label' => ts("Profile"),
251 'pseudoconstant' => [
252 'table' => 'civicrm_uf_group',
254 'labelColumn' => 'title',
259 'name' => 'module_data',
260 'type' => CRM_Utils_Type
::T_LONGTEXT
,
261 'title' => ts('Profile Use Data'),
262 'description' => ts('Json serialized array of data used by the ufjoin.module'),
263 'where' => 'civicrm_uf_join.module_data',
264 'table_name' => 'civicrm_uf_join',
265 'entity' => 'UFJoin',
266 'bao' => 'CRM_Core_BAO_UFJoin',
268 'serialize' => self
::SERIALIZE_JSON
,
272 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
274 return Civi
::$statics[__CLASS__
]['fields'];
278 * Return a mapping from field-name to the corresponding key (as used in fields()).
281 * Array(string $name => string $uniqueName).
283 public static function &fieldKeys() {
284 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
285 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
287 return Civi
::$statics[__CLASS__
]['fieldKeys'];
291 * Returns the names of this table
295 public static function getTableName() {
296 return self
::$_tableName;
300 * Returns if this table needs to be logged
304 public function getLog() {
309 * Returns the list of fields that can be imported
311 * @param bool $prefix
315 public static function &import($prefix = FALSE) {
316 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'uf_join', $prefix, []);
321 * Returns the list of fields that can be exported
323 * @param bool $prefix
327 public static function &export($prefix = FALSE) {
328 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'uf_join', $prefix, []);
333 * Returns the list of indices
335 * @param bool $localize
339 public static function indices($localize = TRUE) {
342 'name' => 'index_entity',
347 'localizable' => FALSE,
348 'sig' => 'civicrm_uf_join::0::entity_table::entity_id',
351 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;