Merge pull request #10549 from jitendrapurohit/CRM-20761
[civicrm-core.git] / CRM / Core / DAO / PrevNextCache.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
0f03f337 6| Copyright CiviCRM LLC (c) 2004-2017 |
e501603b
TO
7+--------------------------------------------------------------------+
8| This file is a part of CiviCRM. |
9| |
10| CiviCRM is free software; you can copy, modify, and distribute it |
11| under the terms of the GNU Affero General Public License |
12| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13| |
14| CiviCRM is distributed in the hope that it will be useful, but |
15| WITHOUT ANY WARRANTY; without even the implied warranty of |
16| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17| See the GNU Affero General Public License for more details. |
18| |
19| You should have received a copy of the GNU Affero General Public |
20| License and the CiviCRM Licensing Exception along |
21| with this program; if not, contact CiviCRM LLC |
22| at info[AT]civicrm[DOT]org. If you have questions about the |
23| GNU Affero General Public License or the licensing of CiviCRM, |
24| see the CiviCRM license FAQ at http://civicrm.org/licensing |
25+--------------------------------------------------------------------+
26*/
27/**
28 * @package CRM
0f03f337 29 * @copyright CiviCRM LLC (c) 2004-2017
e501603b
TO
30 *
31 * Generated from xml/schema/CRM/Core/PrevNextCache.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
e7a6b91a 33 * (GenCodeChecksum:edf9dd4b38ca08a34dbc6990ac954af2)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
f41f0342 37/**
38 * CRM_Core_DAO_PrevNextCache constructor.
39 */
e501603b
TO
40class CRM_Core_DAO_PrevNextCache extends CRM_Core_DAO {
41 /**
f41f0342 42 * Static instance to hold the table name.
e501603b
TO
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_prevnext_cache';
e501603b 47 /**
f41f0342 48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b
TO
49 *
50 * @var boolean
51 */
52 static $_log = false;
53 /**
54 *
55 * @var int unsigned
56 */
57 public $id;
58 /**
59 * physical tablename for entity being joined to discount, e.g. civicrm_event
60 *
61 * @var string
62 */
63 public $entity_table;
64 /**
65 * FK to entity table specified in entity_table column.
66 *
67 * @var int unsigned
68 */
69 public $entity_id1;
70 /**
71 * FK to entity table specified in entity_table column.
72 *
73 * @var int unsigned
74 */
75 public $entity_id2;
76 /**
77 * Unique path name for cache element of the searched item
78 *
79 * @var string
80 */
81 public $cacheKey;
82 /**
83 * cached snapshot of the serialized data
84 *
85 * @var longtext
86 */
87 public $data;
88 /**
89 *
90 * @var boolean
91 */
92 public $is_selected;
93 /**
f41f0342 94 * Class constructor.
e501603b
TO
95 */
96 function __construct() {
97 $this->__table = 'civicrm_prevnext_cache';
98 parent::__construct();
99 }
100 /**
101 * Returns all the column names of this table
102 *
103 * @return array
104 */
105 static function &fields() {
346aaaba
TO
106 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
107 Civi::$statics[__CLASS__]['fields'] = array(
e501603b
TO
108 'id' => array(
109 'name' => 'id',
110 'type' => CRM_Utils_Type::T_INT,
111 'title' => ts('Prev Next Cache ID') ,
112 'required' => true,
522a26c9 113 'table_name' => 'civicrm_prevnext_cache',
114 'entity' => 'PrevNextCache',
115 'bao' => 'CRM_Core_BAO_PrevNextCache',
6a7e5e5d 116 'localizable' => 0,
e501603b
TO
117 ) ,
118 'entity_table' => array(
119 'name' => 'entity_table',
120 'type' => CRM_Utils_Type::T_STRING,
121 'title' => ts('Prev Next Entity Table') ,
122 'description' => 'physical tablename for entity being joined to discount, e.g. civicrm_event',
123 'maxlength' => 64,
124 'size' => CRM_Utils_Type::BIG,
522a26c9 125 'table_name' => 'civicrm_prevnext_cache',
126 'entity' => 'PrevNextCache',
127 'bao' => 'CRM_Core_BAO_PrevNextCache',
6a7e5e5d 128 'localizable' => 0,
e501603b
TO
129 ) ,
130 'entity_id1' => array(
131 'name' => 'entity_id1',
132 'type' => CRM_Utils_Type::T_INT,
133 'title' => ts('Prev Next Entity ID 1') ,
134 'description' => 'FK to entity table specified in entity_table column.',
135 'required' => true,
522a26c9 136 'table_name' => 'civicrm_prevnext_cache',
137 'entity' => 'PrevNextCache',
138 'bao' => 'CRM_Core_BAO_PrevNextCache',
6a7e5e5d 139 'localizable' => 0,
e501603b
TO
140 ) ,
141 'entity_id2' => array(
142 'name' => 'entity_id2',
143 'type' => CRM_Utils_Type::T_INT,
144 'title' => ts('Prev Next Entity ID 2') ,
145 'description' => 'FK to entity table specified in entity_table column.',
146 'required' => true,
522a26c9 147 'table_name' => 'civicrm_prevnext_cache',
148 'entity' => 'PrevNextCache',
149 'bao' => 'CRM_Core_BAO_PrevNextCache',
6a7e5e5d 150 'localizable' => 0,
e501603b
TO
151 ) ,
152 'cacheKey' => array(
153 'name' => 'cacheKey',
154 'type' => CRM_Utils_Type::T_STRING,
155 'title' => ts('Cache Key') ,
156 'description' => 'Unique path name for cache element of the searched item',
157 'maxlength' => 255,
158 'size' => CRM_Utils_Type::HUGE,
522a26c9 159 'table_name' => 'civicrm_prevnext_cache',
160 'entity' => 'PrevNextCache',
161 'bao' => 'CRM_Core_BAO_PrevNextCache',
6a7e5e5d 162 'localizable' => 0,
e501603b
TO
163 ) ,
164 'data' => array(
165 'name' => 'data',
166 'type' => CRM_Utils_Type::T_LONGTEXT,
167 'title' => ts('Prev Next Data') ,
168 'description' => 'cached snapshot of the serialized data',
522a26c9 169 'table_name' => 'civicrm_prevnext_cache',
170 'entity' => 'PrevNextCache',
171 'bao' => 'CRM_Core_BAO_PrevNextCache',
6a7e5e5d 172 'localizable' => 0,
e501603b
TO
173 ) ,
174 'is_selected' => array(
175 'name' => 'is_selected',
176 'type' => CRM_Utils_Type::T_BOOLEAN,
177 'title' => ts('Is Selected') ,
522a26c9 178 'table_name' => 'civicrm_prevnext_cache',
179 'entity' => 'PrevNextCache',
180 'bao' => 'CRM_Core_BAO_PrevNextCache',
6a7e5e5d 181 'localizable' => 0,
e501603b
TO
182 ) ,
183 );
346aaaba 184 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 185 }
346aaaba 186 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
187 }
188 /**
bd8e0b14 189 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
190 *
191 * @return array
bd8e0b14 192 * Array(string $name => string $uniqueName).
e501603b
TO
193 */
194 static function &fieldKeys() {
bd8e0b14
TO
195 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
196 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 197 }
bd8e0b14 198 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
199 }
200 /**
201 * Returns the names of this table
202 *
203 * @return string
204 */
205 static function getTableName() {
206 return self::$_tableName;
207 }
208 /**
209 * Returns if this table needs to be logged
210 *
211 * @return boolean
212 */
213 function getLog() {
214 return self::$_log;
215 }
216 /**
217 * Returns the list of fields that can be imported
218 *
219 * @param bool $prefix
220 *
221 * @return array
222 */
223 static function &import($prefix = false) {
60808919
TO
224 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'prevnext_cache', $prefix, array());
225 return $r;
e501603b
TO
226 }
227 /**
228 * Returns the list of fields that can be exported
229 *
230 * @param bool $prefix
231 *
232 * @return array
233 */
234 static function &export($prefix = false) {
60808919
TO
235 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'prevnext_cache', $prefix, array());
236 return $r;
e501603b 237 }
e7a6b91a
AS
238 /**
239 * Returns the list of indices
240 */
241 public static function indices($localize = TRUE) {
242 $indices = array(
243 'index_all' => array(
244 'name' => 'index_all',
245 'field' => array(
246 0 => 'cacheKey',
247 1 => 'entity_id1',
248 2 => 'entity_id2',
249 3 => 'entity_table',
250 4 => 'is_selected',
251 ) ,
252 'localizable' => false,
253 'sig' => 'civicrm_prevnext_cache::0::cacheKey::entity_id1::entity_id2::entity_table::is_selected',
254 ) ,
255 );
256 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
257 }
e501603b 258}