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:f2e966f7c15ec53893157c9fad65cde2)
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?
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?'),
170 'where' => 'civicrm_uf_join.is_active',
172 'table_name' => 'civicrm_uf_join',
173 'entity' => 'UFJoin',
174 'bao' => 'CRM_Core_BAO_UFJoin',
180 'type' => CRM_Utils_Type
::T_STRING
,
181 'title' => ts('Profile Module'),
182 'description' => ts('Module which owns this uf_join instance, e.g. User Registration, CiviDonate, etc.'),
185 'size' => CRM_Utils_Type
::BIG
,
186 'where' => 'civicrm_uf_join.module',
187 'table_name' => 'civicrm_uf_join',
188 'entity' => 'UFJoin',
189 'bao' => 'CRM_Core_BAO_UFJoin',
194 'name' => 'entity_table',
195 'type' => CRM_Utils_Type
::T_STRING
,
196 'title' => ts('Profile Entity Table'),
197 '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.'),
199 'size' => CRM_Utils_Type
::BIG
,
200 'where' => 'civicrm_uf_join.entity_table',
201 'table_name' => 'civicrm_uf_join',
202 'entity' => 'UFJoin',
203 'bao' => 'CRM_Core_BAO_UFJoin',
205 'pseudoconstant' => [
206 'callback' => 'CRM_Core_BAO_UFJoin::entityTables',
211 'name' => 'entity_id',
212 'type' => CRM_Utils_Type
::T_INT
,
213 'title' => ts('Profile Entity ID'),
214 'description' => ts('Foreign key to the referenced item.'),
215 'where' => 'civicrm_uf_join.entity_id',
216 'table_name' => 'civicrm_uf_join',
217 'entity' => 'UFJoin',
218 'bao' => 'CRM_Core_BAO_UFJoin',
224 'type' => CRM_Utils_Type
::T_INT
,
225 'title' => ts('Order'),
226 'description' => ts('Controls display order when multiple user framework groups are setup for concurrent display.'),
228 'where' => 'civicrm_uf_join.weight',
230 'table_name' => 'civicrm_uf_join',
231 'entity' => 'UFJoin',
232 'bao' => 'CRM_Core_BAO_UFJoin',
237 'name' => 'uf_group_id',
238 'type' => CRM_Utils_Type
::T_INT
,
239 'title' => ts('Profile ID'),
240 'description' => ts('Which form does this field belong to.'),
242 'where' => 'civicrm_uf_join.uf_group_id',
243 'table_name' => 'civicrm_uf_join',
244 'entity' => 'UFJoin',
245 'bao' => 'CRM_Core_BAO_UFJoin',
247 'FKClassName' => 'CRM_Core_DAO_UFGroup',
250 'label' => ts("Profile"),
252 'pseudoconstant' => [
253 'table' => 'civicrm_uf_group',
255 'labelColumn' => 'title',
260 'name' => 'module_data',
261 'type' => CRM_Utils_Type
::T_LONGTEXT
,
262 'title' => ts('Profile Use Data'),
263 'description' => ts('Json serialized array of data used by the ufjoin.module'),
264 'where' => 'civicrm_uf_join.module_data',
265 'table_name' => 'civicrm_uf_join',
266 'entity' => 'UFJoin',
267 'bao' => 'CRM_Core_BAO_UFJoin',
269 'serialize' => self
::SERIALIZE_JSON
,
273 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
275 return Civi
::$statics[__CLASS__
]['fields'];
279 * Return a mapping from field-name to the corresponding key (as used in fields()).
282 * Array(string $name => string $uniqueName).
284 public static function &fieldKeys() {
285 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
286 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
288 return Civi
::$statics[__CLASS__
]['fieldKeys'];
292 * Returns the names of this table
296 public static function getTableName() {
297 return self
::$_tableName;
301 * Returns if this table needs to be logged
305 public function getLog() {
310 * Returns the list of fields that can be imported
312 * @param bool $prefix
316 public static function &import($prefix = FALSE) {
317 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'uf_join', $prefix, []);
322 * Returns the list of fields that can be exported
324 * @param bool $prefix
328 public static function &export($prefix = FALSE) {
329 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'uf_join', $prefix, []);
334 * Returns the list of indices
336 * @param bool $localize
340 public static function indices($localize = TRUE) {
343 'name' => 'index_entity',
348 'localizable' => FALSE,
349 'sig' => 'civicrm_uf_join::0::entity_table::entity_id',
352 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;