5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Contact/GroupContactCache.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:e0978847d01b9b3f7819759f8171344c)
13 * Database access object for the GroupContactCache entity.
15 class CRM_Contact_DAO_GroupContactCache
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_group_contact_cache';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
46 * FK to civicrm_contact
55 public function __construct() {
56 $this->__table
= 'civicrm_group_contact_cache';
57 parent
::__construct();
61 * Returns foreign keys and entity references.
64 * [CRM_Core_Reference_Interface]
66 public static function getReferenceColumns() {
67 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
68 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
69 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'group_id', 'civicrm_group', 'id');
70 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
71 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
73 return Civi
::$statics[__CLASS__
]['links'];
77 * Returns all the column names of this table
81 public static function &fields() {
82 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
83 Civi
::$statics[__CLASS__
]['fields'] = [
86 'type' => CRM_Utils_Type
::T_INT
,
87 'title' => ts('Group Contact Cache ID'),
88 'description' => ts('primary key'),
90 'where' => 'civicrm_group_contact_cache.id',
91 'table_name' => 'civicrm_group_contact_cache',
92 'entity' => 'GroupContactCache',
93 'bao' => 'CRM_Contact_BAO_GroupContactCache',
98 'type' => CRM_Utils_Type
::T_INT
,
99 'title' => ts('Group'),
100 'description' => ts('FK to civicrm_group'),
102 'where' => 'civicrm_group_contact_cache.group_id',
103 'table_name' => 'civicrm_group_contact_cache',
104 'entity' => 'GroupContactCache',
105 'bao' => 'CRM_Contact_BAO_GroupContactCache',
107 'FKClassName' => 'CRM_Contact_DAO_Group',
111 'pseudoconstant' => [
112 'table' => 'civicrm_group',
114 'labelColumn' => 'title',
118 'name' => 'contact_id',
119 'type' => CRM_Utils_Type
::T_INT
,
120 'title' => ts('Contact ID'),
121 'description' => ts('FK to civicrm_contact'),
123 'where' => 'civicrm_group_contact_cache.contact_id',
124 'table_name' => 'civicrm_group_contact_cache',
125 'entity' => 'GroupContactCache',
126 'bao' => 'CRM_Contact_BAO_GroupContactCache',
128 'FKClassName' => 'CRM_Contact_DAO_Contact',
131 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
133 return Civi
::$statics[__CLASS__
]['fields'];
137 * Return a mapping from field-name to the corresponding key (as used in fields()).
140 * Array(string $name => string $uniqueName).
142 public static function &fieldKeys() {
143 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
144 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
146 return Civi
::$statics[__CLASS__
]['fieldKeys'];
150 * Returns the names of this table
154 public static function getTableName() {
155 return self
::$_tableName;
159 * Returns if this table needs to be logged
163 public function getLog() {
168 * Returns the list of fields that can be imported
170 * @param bool $prefix
174 public static function &import($prefix = FALSE) {
175 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'group_contact_cache', $prefix, []);
180 * Returns the list of fields that can be exported
182 * @param bool $prefix
186 public static function &export($prefix = FALSE) {
187 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'group_contact_cache', $prefix, []);
192 * Returns the list of indices
194 * @param bool $localize
198 public static function indices($localize = TRUE) {
200 'UI_contact_group' => [
201 'name' => 'UI_contact_group',
206 'localizable' => FALSE,
208 'sig' => 'civicrm_group_contact_cache::1::contact_id::group_id',
211 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;