5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/PrevNextCache.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:325d605774498631dd0a2742963d1032)
13 * Database access object for the PrevNextCache entity.
15 class CRM_Core_DAO_PrevNextCache
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '3.4';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_prevnext_cache';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
39 * physical tablename for entity being joined to discount, e.g. civicrm_event
46 * FK to entity table specified in entity_table column.
53 * FK to entity table specified in entity_table column.
60 * Unique path name for cache element of the searched item
67 * cached snapshot of the serialized data
81 public function __construct() {
82 $this->__table
= 'civicrm_prevnext_cache';
83 parent
::__construct();
87 * Returns localized title of this entity.
90 * Whether to return the plural version of the title.
92 public static function getEntityTitle($plural = FALSE) {
93 return $plural ?
ts('Prev Next Caches') : ts('Prev Next Cache');
97 * Returns all the column names of this table
101 public static function &fields() {
102 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
103 Civi
::$statics[__CLASS__
]['fields'] = [
106 'type' => CRM_Utils_Type
::T_INT
,
107 'title' => ts('Prev Next Cache ID'),
109 'where' => 'civicrm_prevnext_cache.id',
110 'table_name' => 'civicrm_prevnext_cache',
111 'entity' => 'PrevNextCache',
112 'bao' => 'CRM_Core_BAO_PrevNextCache',
117 'name' => 'entity_table',
118 'type' => CRM_Utils_Type
::T_STRING
,
119 'title' => ts('Prev Next Entity Table'),
120 'description' => ts('physical tablename for entity being joined to discount, e.g. civicrm_event'),
122 'size' => CRM_Utils_Type
::BIG
,
123 'where' => 'civicrm_prevnext_cache.entity_table',
124 'table_name' => 'civicrm_prevnext_cache',
125 'entity' => 'PrevNextCache',
126 'bao' => 'CRM_Core_BAO_PrevNextCache',
131 'name' => 'entity_id1',
132 'type' => CRM_Utils_Type
::T_INT
,
133 'title' => ts('Prev Next Entity ID 1'),
134 'description' => ts('FK to entity table specified in entity_table column.'),
136 'where' => 'civicrm_prevnext_cache.entity_id1',
137 'table_name' => 'civicrm_prevnext_cache',
138 'entity' => 'PrevNextCache',
139 'bao' => 'CRM_Core_BAO_PrevNextCache',
144 'name' => 'entity_id2',
145 'type' => CRM_Utils_Type
::T_INT
,
146 'title' => ts('Prev Next Entity ID 2'),
147 'description' => ts('FK to entity table specified in entity_table column.'),
149 'where' => 'civicrm_prevnext_cache.entity_id2',
150 'table_name' => 'civicrm_prevnext_cache',
151 'entity' => 'PrevNextCache',
152 'bao' => 'CRM_Core_BAO_PrevNextCache',
157 'name' => 'cachekey',
158 'type' => CRM_Utils_Type
::T_STRING
,
159 'title' => ts('Cache Key'),
160 'description' => ts('Unique path name for cache element of the searched item'),
162 'size' => CRM_Utils_Type
::HUGE
,
163 'where' => 'civicrm_prevnext_cache.cachekey',
164 'table_name' => 'civicrm_prevnext_cache',
165 'entity' => 'PrevNextCache',
166 'bao' => 'CRM_Core_BAO_PrevNextCache',
172 'type' => CRM_Utils_Type
::T_LONGTEXT
,
173 'title' => ts('Prev Next Data'),
174 'description' => ts('cached snapshot of the serialized data'),
175 'where' => 'civicrm_prevnext_cache.data',
176 'table_name' => 'civicrm_prevnext_cache',
177 'entity' => 'PrevNextCache',
178 'bao' => 'CRM_Core_BAO_PrevNextCache',
180 'serialize' => self
::SERIALIZE_PHP
,
184 'name' => 'is_selected',
185 'type' => CRM_Utils_Type
::T_BOOLEAN
,
186 'title' => ts('Is Selected'),
187 'where' => 'civicrm_prevnext_cache.is_selected',
189 'table_name' => 'civicrm_prevnext_cache',
190 'entity' => 'PrevNextCache',
191 'bao' => 'CRM_Core_BAO_PrevNextCache',
196 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
198 return Civi
::$statics[__CLASS__
]['fields'];
202 * Return a mapping from field-name to the corresponding key (as used in fields()).
205 * Array(string $name => string $uniqueName).
207 public static function &fieldKeys() {
208 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
209 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
211 return Civi
::$statics[__CLASS__
]['fieldKeys'];
215 * Returns the names of this table
219 public static function getTableName() {
220 return self
::$_tableName;
224 * Returns if this table needs to be logged
228 public function getLog() {
233 * Returns the list of fields that can be imported
235 * @param bool $prefix
239 public static function &import($prefix = FALSE) {
240 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'prevnext_cache', $prefix, []);
245 * Returns the list of fields that can be exported
247 * @param bool $prefix
251 public static function &export($prefix = FALSE) {
252 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'prevnext_cache', $prefix, []);
257 * Returns the list of indices
259 * @param bool $localize
263 public static function indices($localize = TRUE) {
266 'name' => 'index_all',
274 'localizable' => FALSE,
275 'sig' => 'civicrm_prevnext_cache::0::cachekey::entity_id1::entity_id2::entity_table::is_selected',
278 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;