fixup CRM-14885 - Import DAOs
[civicrm-core.git] / CRM / Core / DAO / PrevNextCache.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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
29 * @copyright CiviCRM LLC (c) 2004-2016
30 *
31 * Generated from xml/schema/CRM/Core/PrevNextCache.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:50673715dba67219734f6235bf18f0db)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_PrevNextCache extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_prevnext_cache';
44 /**
45 * static instance to hold the field values
46 *
47 * @var array
48 */
49 static $_fields = null;
50 /**
51 * static instance to hold the keys used in $_fields for each field.
52 *
53 * @var array
54 */
55 static $_fieldKeys = null;
56 /**
57 * static instance to hold the FK relationships
58 *
59 * @var string
60 */
61 static $_links = null;
62 /**
63 * static instance to hold the values that can
64 * be imported
65 *
66 * @var array
67 */
68 static $_import = null;
69 /**
70 * static instance to hold the values that can
71 * be exported
72 *
73 * @var array
74 */
75 static $_export = null;
76 /**
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
79 *
80 * @var boolean
81 */
82 static $_log = false;
83 /**
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * physical tablename for entity being joined to discount, e.g. civicrm_event
90 *
91 * @var string
92 */
93 public $entity_table;
94 /**
95 * FK to entity table specified in entity_table column.
96 *
97 * @var int unsigned
98 */
99 public $entity_id1;
100 /**
101 * FK to entity table specified in entity_table column.
102 *
103 * @var int unsigned
104 */
105 public $entity_id2;
106 /**
107 * Unique path name for cache element of the searched item
108 *
109 * @var string
110 */
111 public $cacheKey;
112 /**
113 * cached snapshot of the serialized data
114 *
115 * @var longtext
116 */
117 public $data;
118 /**
119 *
120 * @var boolean
121 */
122 public $is_selected;
123 /**
124 * class constructor
125 *
126 * @return civicrm_prevnext_cache
127 */
128 function __construct() {
129 $this->__table = 'civicrm_prevnext_cache';
130 parent::__construct();
131 }
132 /**
133 * Returns all the column names of this table
134 *
135 * @return array
136 */
137 static function &fields() {
138 if (!(self::$_fields)) {
139 self::$_fields = array(
140 'id' => array(
141 'name' => 'id',
142 'type' => CRM_Utils_Type::T_INT,
143 'title' => ts('Prev Next Cache ID') ,
144 'required' => true,
145 ) ,
146 'entity_table' => array(
147 'name' => 'entity_table',
148 'type' => CRM_Utils_Type::T_STRING,
149 'title' => ts('Prev Next Entity Table') ,
150 'description' => 'physical tablename for entity being joined to discount, e.g. civicrm_event',
151 'maxlength' => 64,
152 'size' => CRM_Utils_Type::BIG,
153 ) ,
154 'entity_id1' => array(
155 'name' => 'entity_id1',
156 'type' => CRM_Utils_Type::T_INT,
157 'title' => ts('Prev Next Entity ID 1') ,
158 'description' => 'FK to entity table specified in entity_table column.',
159 'required' => true,
160 ) ,
161 'entity_id2' => array(
162 'name' => 'entity_id2',
163 'type' => CRM_Utils_Type::T_INT,
164 'title' => ts('Prev Next Entity ID 2') ,
165 'description' => 'FK to entity table specified in entity_table column.',
166 'required' => true,
167 ) ,
168 'cacheKey' => array(
169 'name' => 'cacheKey',
170 'type' => CRM_Utils_Type::T_STRING,
171 'title' => ts('Cache Key') ,
172 'description' => 'Unique path name for cache element of the searched item',
173 'maxlength' => 255,
174 'size' => CRM_Utils_Type::HUGE,
175 ) ,
176 'data' => array(
177 'name' => 'data',
178 'type' => CRM_Utils_Type::T_LONGTEXT,
179 'title' => ts('Prev Next Data') ,
180 'description' => 'cached snapshot of the serialized data',
181 ) ,
182 'is_selected' => array(
183 'name' => 'is_selected',
184 'type' => CRM_Utils_Type::T_BOOLEAN,
185 'title' => ts('Is Selected') ,
186 ) ,
187 );
188 }
189 return self::$_fields;
190 }
191 /**
192 * Returns an array containing, for each field, the arary key used for that
193 * field in self::$_fields.
194 *
195 * @return array
196 */
197 static function &fieldKeys() {
198 if (!(self::$_fieldKeys)) {
199 self::$_fieldKeys = array(
200 'id' => 'id',
201 'entity_table' => 'entity_table',
202 'entity_id1' => 'entity_id1',
203 'entity_id2' => 'entity_id2',
204 'cacheKey' => 'cacheKey',
205 'data' => 'data',
206 'is_selected' => 'is_selected',
207 );
208 }
209 return self::$_fieldKeys;
210 }
211 /**
212 * Returns the names of this table
213 *
214 * @return string
215 */
216 static function getTableName() {
217 return self::$_tableName;
218 }
219 /**
220 * Returns if this table needs to be logged
221 *
222 * @return boolean
223 */
224 function getLog() {
225 return self::$_log;
226 }
227 /**
228 * Returns the list of fields that can be imported
229 *
230 * @param bool $prefix
231 *
232 * @return array
233 */
234 static function &import($prefix = false) {
235 if (!(self::$_import)) {
236 self::$_import = array();
237 $fields = self::fields();
238 foreach($fields as $name => $field) {
239 if (CRM_Utils_Array::value('import', $field)) {
240 if ($prefix) {
241 self::$_import['prevnext_cache'] = & $fields[$name];
242 } else {
243 self::$_import[$name] = & $fields[$name];
244 }
245 }
246 }
247 }
248 return self::$_import;
249 }
250 /**
251 * Returns the list of fields that can be exported
252 *
253 * @param bool $prefix
254 *
255 * @return array
256 */
257 static function &export($prefix = false) {
258 if (!(self::$_export)) {
259 self::$_export = array();
260 $fields = self::fields();
261 foreach($fields as $name => $field) {
262 if (CRM_Utils_Array::value('export', $field)) {
263 if ($prefix) {
264 self::$_export['prevnext_cache'] = & $fields[$name];
265 } else {
266 self::$_export[$name] = & $fields[$name];
267 }
268 }
269 }
270 }
271 return self::$_export;
272 }
273 }