Merge pull request #8916 from cividesk/CRM-19256-4.7
[civicrm-core.git] / CRM / Core / DAO / PrevNextCache.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
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-2017
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 /**
38 * CRM_Core_DAO_PrevNextCache constructor.
39 */
40 class CRM_Core_DAO_PrevNextCache extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_prevnext_cache';
47 /**
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 /**
94 * Class constructor.
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() {
106 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
107 Civi::$statics[__CLASS__]['fields'] = array(
108 'id' => array(
109 'name' => 'id',
110 'type' => CRM_Utils_Type::T_INT,
111 'title' => ts('Prev Next Cache ID') ,
112 'required' => true,
113 ) ,
114 'entity_table' => array(
115 'name' => 'entity_table',
116 'type' => CRM_Utils_Type::T_STRING,
117 'title' => ts('Prev Next Entity Table') ,
118 'description' => 'physical tablename for entity being joined to discount, e.g. civicrm_event',
119 'maxlength' => 64,
120 'size' => CRM_Utils_Type::BIG,
121 ) ,
122 'entity_id1' => array(
123 'name' => 'entity_id1',
124 'type' => CRM_Utils_Type::T_INT,
125 'title' => ts('Prev Next Entity ID 1') ,
126 'description' => 'FK to entity table specified in entity_table column.',
127 'required' => true,
128 ) ,
129 'entity_id2' => array(
130 'name' => 'entity_id2',
131 'type' => CRM_Utils_Type::T_INT,
132 'title' => ts('Prev Next Entity ID 2') ,
133 'description' => 'FK to entity table specified in entity_table column.',
134 'required' => true,
135 ) ,
136 'cacheKey' => array(
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 ) ,
144 'data' => array(
145 'name' => 'data',
146 'type' => CRM_Utils_Type::T_LONGTEXT,
147 'title' => ts('Prev Next Data') ,
148 'description' => 'cached snapshot of the serialized data',
149 ) ,
150 'is_selected' => array(
151 'name' => 'is_selected',
152 'type' => CRM_Utils_Type::T_BOOLEAN,
153 'title' => ts('Is Selected') ,
154 ) ,
155 );
156 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
157 }
158 return Civi::$statics[__CLASS__]['fields'];
159 }
160 /**
161 * Return a mapping from field-name to the corresponding key (as used in fields()).
162 *
163 * @return array
164 * Array(string $name => string $uniqueName).
165 */
166 static function &fieldKeys() {
167 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
168 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
169 }
170 return Civi::$statics[__CLASS__]['fieldKeys'];
171 }
172 /**
173 * Returns the names of this table
174 *
175 * @return string
176 */
177 static function getTableName() {
178 return self::$_tableName;
179 }
180 /**
181 * Returns if this table needs to be logged
182 *
183 * @return boolean
184 */
185 function getLog() {
186 return self::$_log;
187 }
188 /**
189 * Returns the list of fields that can be imported
190 *
191 * @param bool $prefix
192 *
193 * @return array
194 */
195 static function &import($prefix = false) {
196 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'prevnext_cache', $prefix, array());
197 return $r;
198 }
199 /**
200 * Returns the list of fields that can be exported
201 *
202 * @param bool $prefix
203 *
204 * @return array
205 */
206 static function &export($prefix = false) {
207 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'prevnext_cache', $prefix, array());
208 return $r;
209 }
210 }