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:a169b776ec9bfc8864a05750d4ae6b95)
13 * Database access object for the GroupContactCache entity.
15 class CRM_Contact_DAO_GroupContactCache
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '2.1';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_group_contact_cache';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
48 * FK to civicrm_contact
57 public function __construct() {
58 $this->__table
= 'civicrm_group_contact_cache';
59 parent
::__construct();
63 * Returns localized title of this entity.
65 public static function getEntityTitle() {
66 return ts('Group Contact Caches');
70 * Returns foreign keys and entity references.
73 * [CRM_Core_Reference_Interface]
75 public static function getReferenceColumns() {
76 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
77 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
78 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'group_id', 'civicrm_group', 'id');
79 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contact_id', 'civicrm_contact', 'id');
80 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
82 return Civi
::$statics[__CLASS__
]['links'];
86 * Returns all the column names of this table
90 public static function &fields() {
91 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
92 Civi
::$statics[__CLASS__
]['fields'] = [
95 'type' => CRM_Utils_Type
::T_INT
,
96 'title' => ts('Group Contact Cache ID'),
97 'description' => ts('primary key'),
99 'where' => 'civicrm_group_contact_cache.id',
100 'table_name' => 'civicrm_group_contact_cache',
101 'entity' => 'GroupContactCache',
102 'bao' => 'CRM_Contact_BAO_GroupContactCache',
107 'name' => 'group_id',
108 'type' => CRM_Utils_Type
::T_INT
,
109 'title' => ts('Group'),
110 'description' => ts('FK to civicrm_group'),
112 'where' => 'civicrm_group_contact_cache.group_id',
113 'table_name' => 'civicrm_group_contact_cache',
114 'entity' => 'GroupContactCache',
115 'bao' => 'CRM_Contact_BAO_GroupContactCache',
117 'FKClassName' => 'CRM_Contact_DAO_Group',
121 'pseudoconstant' => [
122 'table' => 'civicrm_group',
124 'labelColumn' => 'title',
129 'name' => 'contact_id',
130 'type' => CRM_Utils_Type
::T_INT
,
131 'title' => ts('Contact ID'),
132 'description' => ts('FK to civicrm_contact'),
134 'where' => 'civicrm_group_contact_cache.contact_id',
135 'table_name' => 'civicrm_group_contact_cache',
136 'entity' => 'GroupContactCache',
137 'bao' => 'CRM_Contact_BAO_GroupContactCache',
139 'FKClassName' => 'CRM_Contact_DAO_Contact',
143 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
145 return Civi
::$statics[__CLASS__
]['fields'];
149 * Return a mapping from field-name to the corresponding key (as used in fields()).
152 * Array(string $name => string $uniqueName).
154 public static function &fieldKeys() {
155 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
156 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
158 return Civi
::$statics[__CLASS__
]['fieldKeys'];
162 * Returns the names of this table
166 public static function getTableName() {
167 return self
::$_tableName;
171 * Returns if this table needs to be logged
175 public function getLog() {
180 * Returns the list of fields that can be imported
182 * @param bool $prefix
186 public static function &import($prefix = FALSE) {
187 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'group_contact_cache', $prefix, []);
192 * Returns the list of fields that can be exported
194 * @param bool $prefix
198 public static function &export($prefix = FALSE) {
199 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'group_contact_cache', $prefix, []);
204 * Returns the list of indices
206 * @param bool $localize
210 public static function indices($localize = TRUE) {
212 'UI_contact_group' => [
213 'name' => 'UI_contact_group',
218 'localizable' => FALSE,
220 'sig' => 'civicrm_group_contact_cache::1::contact_id::group_id',
223 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;