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:34c9a3b8f37f15fa5f0d9174e5e1c981)
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;
34 * @var int|string|null
35 * (SQL type: int unsigned)
36 * Note that values will be retrieved from the database as a string.
41 * physical tablename for entity being joined to discount, e.g. civicrm_event
44 * (SQL type: varchar(64))
45 * Note that values will be retrieved from the database as a string.
50 * FK to entity table specified in entity_table column.
53 * (SQL type: int unsigned)
54 * Note that values will be retrieved from the database as a string.
59 * FK to entity table specified in entity_table column.
62 * (SQL type: int unsigned)
63 * Note that values will be retrieved from the database as a string.
68 * Unique path name for cache element of the searched item
71 * (SQL type: varchar(255))
72 * Note that values will be retrieved from the database as a string.
77 * cached snapshot of the serialized data
80 * (SQL type: longtext)
81 * Note that values will be retrieved from the database as a string.
86 * @var bool|string|null
88 * Note that values will be retrieved from the database as a string.
95 public function __construct() {
96 $this->__table
= 'civicrm_prevnext_cache';
97 parent
::__construct();
101 * Returns localized title of this entity.
103 * @param bool $plural
104 * Whether to return the plural version of the title.
106 public static function getEntityTitle($plural = FALSE) {
107 return $plural ?
ts('Prev Next Caches') : ts('Prev Next Cache');
111 * Returns all the column names of this table
115 public static function &fields() {
116 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
117 Civi
::$statics[__CLASS__
]['fields'] = [
120 'type' => CRM_Utils_Type
::T_INT
,
121 'title' => ts('Prev Next Cache ID'),
123 'where' => 'civicrm_prevnext_cache.id',
124 'table_name' => 'civicrm_prevnext_cache',
125 'entity' => 'PrevNextCache',
126 'bao' => 'CRM_Core_BAO_PrevNextCache',
135 'name' => 'entity_table',
136 'type' => CRM_Utils_Type
::T_STRING
,
137 'title' => ts('Prev Next Entity Table'),
138 'description' => ts('physical tablename for entity being joined to discount, e.g. civicrm_event'),
140 'size' => CRM_Utils_Type
::BIG
,
141 'where' => 'civicrm_prevnext_cache.entity_table',
142 'table_name' => 'civicrm_prevnext_cache',
143 'entity' => 'PrevNextCache',
144 'bao' => 'CRM_Core_BAO_PrevNextCache',
149 'name' => 'entity_id1',
150 'type' => CRM_Utils_Type
::T_INT
,
151 'title' => ts('Prev Next Entity ID 1'),
152 'description' => ts('FK to entity table specified in entity_table column.'),
154 'where' => 'civicrm_prevnext_cache.entity_id1',
155 'table_name' => 'civicrm_prevnext_cache',
156 'entity' => 'PrevNextCache',
157 'bao' => 'CRM_Core_BAO_PrevNextCache',
162 'name' => 'entity_id2',
163 'type' => CRM_Utils_Type
::T_INT
,
164 'title' => ts('Prev Next Entity ID 2'),
165 'description' => ts('FK to entity table specified in entity_table column.'),
167 'where' => 'civicrm_prevnext_cache.entity_id2',
168 'table_name' => 'civicrm_prevnext_cache',
169 'entity' => 'PrevNextCache',
170 'bao' => 'CRM_Core_BAO_PrevNextCache',
175 'name' => 'cachekey',
176 'type' => CRM_Utils_Type
::T_STRING
,
177 'title' => ts('Cache Key'),
178 'description' => ts('Unique path name for cache element of the searched item'),
180 'size' => CRM_Utils_Type
::HUGE
,
181 'where' => 'civicrm_prevnext_cache.cachekey',
182 'table_name' => 'civicrm_prevnext_cache',
183 'entity' => 'PrevNextCache',
184 'bao' => 'CRM_Core_BAO_PrevNextCache',
190 'type' => CRM_Utils_Type
::T_LONGTEXT
,
191 'title' => ts('Prev Next Data'),
192 'description' => ts('cached snapshot of the serialized data'),
193 'where' => 'civicrm_prevnext_cache.data',
194 'table_name' => 'civicrm_prevnext_cache',
195 'entity' => 'PrevNextCache',
196 'bao' => 'CRM_Core_BAO_PrevNextCache',
198 'serialize' => self
::SERIALIZE_PHP
,
202 'name' => 'is_selected',
203 'type' => CRM_Utils_Type
::T_BOOLEAN
,
204 'title' => ts('Is Selected'),
205 'where' => 'civicrm_prevnext_cache.is_selected',
207 'table_name' => 'civicrm_prevnext_cache',
208 'entity' => 'PrevNextCache',
209 'bao' => 'CRM_Core_BAO_PrevNextCache',
214 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
216 return Civi
::$statics[__CLASS__
]['fields'];
220 * Return a mapping from field-name to the corresponding key (as used in fields()).
223 * Array(string $name => string $uniqueName).
225 public static function &fieldKeys() {
226 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
227 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
229 return Civi
::$statics[__CLASS__
]['fieldKeys'];
233 * Returns the names of this table
237 public static function getTableName() {
238 return self
::$_tableName;
242 * Returns if this table needs to be logged
246 public function getLog() {
251 * Returns the list of fields that can be imported
253 * @param bool $prefix
257 public static function &import($prefix = FALSE) {
258 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'prevnext_cache', $prefix, []);
263 * Returns the list of fields that can be exported
265 * @param bool $prefix
269 public static function &export($prefix = FALSE) {
270 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'prevnext_cache', $prefix, []);
275 * Returns the list of indices
277 * @param bool $localize
281 public static function indices($localize = TRUE) {
284 'name' => 'index_all',
292 'localizable' => FALSE,
293 'sig' => 'civicrm_prevnext_cache::0::cachekey::entity_id1::entity_id2::entity_table::is_selected',
296 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;