Delete entities in the reverse order that they were created
[civicrm-core.git] / CRM / Core / DAO / PrevNextCache.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2018
6 *
7 * Generated from xml/schema/CRM/Core/PrevNextCache.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:cfce4435348e53ba9941ce5ed223c05b)
10 */
11
12 /**
13 * Database access object for the PrevNextCache entity.
14 */
15 class CRM_Core_DAO_PrevNextCache extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_prevnext_cache';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 static $_log = FALSE;
30
31 /**
32 * @var int unsigned
33 */
34 public $id;
35
36 /**
37 * physical tablename for entity being joined to discount, e.g. civicrm_event
38 *
39 * @var string
40 */
41 public $entity_table;
42
43 /**
44 * FK to entity table specified in entity_table column.
45 *
46 * @var int unsigned
47 */
48 public $entity_id1;
49
50 /**
51 * FK to entity table specified in entity_table column.
52 *
53 * @var int unsigned
54 */
55 public $entity_id2;
56
57 /**
58 * Unique path name for cache element of the searched item
59 *
60 * @var string
61 */
62 public $cacheKey;
63
64 /**
65 * cached snapshot of the serialized data
66 *
67 * @var longtext
68 */
69 public $data;
70
71 /**
72 * @var boolean
73 */
74 public $is_selected;
75
76 /**
77 * Class constructor.
78 */
79 public function __construct() {
80 $this->__table = 'civicrm_prevnext_cache';
81 parent::__construct();
82 }
83
84 /**
85 * Returns all the column names of this table
86 *
87 * @return array
88 */
89 public static function &fields() {
90 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
91 Civi::$statics[__CLASS__]['fields'] = [
92 'id' => [
93 'name' => 'id',
94 'type' => CRM_Utils_Type::T_INT,
95 'title' => ts('Prev Next Cache ID'),
96 'required' => TRUE,
97 'table_name' => 'civicrm_prevnext_cache',
98 'entity' => 'PrevNextCache',
99 'bao' => 'CRM_Core_BAO_PrevNextCache',
100 'localizable' => 0,
101 ],
102 'entity_table' => [
103 'name' => 'entity_table',
104 'type' => CRM_Utils_Type::T_STRING,
105 'title' => ts('Prev Next Entity Table'),
106 'description' => 'physical tablename for entity being joined to discount, e.g. civicrm_event',
107 'maxlength' => 64,
108 'size' => CRM_Utils_Type::BIG,
109 'table_name' => 'civicrm_prevnext_cache',
110 'entity' => 'PrevNextCache',
111 'bao' => 'CRM_Core_BAO_PrevNextCache',
112 'localizable' => 0,
113 ],
114 'entity_id1' => [
115 'name' => 'entity_id1',
116 'type' => CRM_Utils_Type::T_INT,
117 'title' => ts('Prev Next Entity ID 1'),
118 'description' => 'FK to entity table specified in entity_table column.',
119 'required' => TRUE,
120 'table_name' => 'civicrm_prevnext_cache',
121 'entity' => 'PrevNextCache',
122 'bao' => 'CRM_Core_BAO_PrevNextCache',
123 'localizable' => 0,
124 ],
125 'entity_id2' => [
126 'name' => 'entity_id2',
127 'type' => CRM_Utils_Type::T_INT,
128 'title' => ts('Prev Next Entity ID 2'),
129 'description' => 'FK to entity table specified in entity_table column.',
130 'required' => TRUE,
131 'table_name' => 'civicrm_prevnext_cache',
132 'entity' => 'PrevNextCache',
133 'bao' => 'CRM_Core_BAO_PrevNextCache',
134 'localizable' => 0,
135 ],
136 'cacheKey' => [
137 'name' => 'cacheKey',
138 'type' => CRM_Utils_Type::T_STRING,
139 'title' => ts('Cache Key'),
140 'description' => 'Unique path name for cache element of the searched item',
141 'maxlength' => 255,
142 'size' => CRM_Utils_Type::HUGE,
143 'table_name' => 'civicrm_prevnext_cache',
144 'entity' => 'PrevNextCache',
145 'bao' => 'CRM_Core_BAO_PrevNextCache',
146 'localizable' => 0,
147 ],
148 'data' => [
149 'name' => 'data',
150 'type' => CRM_Utils_Type::T_LONGTEXT,
151 'title' => ts('Prev Next Data'),
152 'description' => 'cached snapshot of the serialized data',
153 'table_name' => 'civicrm_prevnext_cache',
154 'entity' => 'PrevNextCache',
155 'bao' => 'CRM_Core_BAO_PrevNextCache',
156 'localizable' => 0,
157 'serialize' => self::SERIALIZE_PHP,
158 ],
159 'is_selected' => [
160 'name' => 'is_selected',
161 'type' => CRM_Utils_Type::T_BOOLEAN,
162 'title' => ts('Is Selected'),
163 'table_name' => 'civicrm_prevnext_cache',
164 'entity' => 'PrevNextCache',
165 'bao' => 'CRM_Core_BAO_PrevNextCache',
166 'localizable' => 0,
167 ],
168 ];
169 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
170 }
171 return Civi::$statics[__CLASS__]['fields'];
172 }
173
174 /**
175 * Return a mapping from field-name to the corresponding key (as used in fields()).
176 *
177 * @return array
178 * Array(string $name => string $uniqueName).
179 */
180 public static function &fieldKeys() {
181 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
182 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
183 }
184 return Civi::$statics[__CLASS__]['fieldKeys'];
185 }
186
187 /**
188 * Returns the names of this table
189 *
190 * @return string
191 */
192 public static function getTableName() {
193 return self::$_tableName;
194 }
195
196 /**
197 * Returns if this table needs to be logged
198 *
199 * @return bool
200 */
201 public function getLog() {
202 return self::$_log;
203 }
204
205 /**
206 * Returns the list of fields that can be imported
207 *
208 * @param bool $prefix
209 *
210 * @return array
211 */
212 public static function &import($prefix = FALSE) {
213 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'prevnext_cache', $prefix, []);
214 return $r;
215 }
216
217 /**
218 * Returns the list of fields that can be exported
219 *
220 * @param bool $prefix
221 *
222 * @return array
223 */
224 public static function &export($prefix = FALSE) {
225 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'prevnext_cache', $prefix, []);
226 return $r;
227 }
228
229 /**
230 * Returns the list of indices
231 *
232 * @param bool $localize
233 *
234 * @return array
235 */
236 public static function indices($localize = TRUE) {
237 $indices = [
238 'index_all' => [
239 'name' => 'index_all',
240 'field' => [
241 0 => 'cacheKey',
242 1 => 'entity_id1',
243 2 => 'entity_id2',
244 3 => 'entity_table',
245 4 => 'is_selected',
246 ],
247 'localizable' => FALSE,
248 'sig' => 'civicrm_prevnext_cache::0::cacheKey::entity_id1::entity_id2::entity_table::is_selected',
249 ],
250 ];
251 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
252 }
253
254 }