API/DAO Metadata - Retain versioning metadata for possible usage in runtime+tooling
[civicrm-core.git] / CRM / Core / DAO / Dashboard.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Core/Dashboard.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:8cc83b4a4fa0fe28868e33887824c4e5)
10 */
11
12 /**
13 * Database access object for the Dashboard entity.
14 */
15 class CRM_Core_DAO_Dashboard extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_dashboard';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 public static $_log = FALSE;
30
31 /**
32 * @var int
33 */
34 public $id;
35
36 /**
37 * Domain for dashboard
38 *
39 * @var int
40 */
41 public $domain_id;
42
43 /**
44 * Internal name of dashlet.
45 *
46 * @var string
47 */
48 public $name;
49
50 /**
51 * dashlet title
52 *
53 * @var string
54 */
55 public $label;
56
57 /**
58 * url in case of external dashlet
59 *
60 * @var string
61 */
62 public $url;
63
64 /**
65 * Permission for the dashlet
66 *
67 * @var string
68 */
69 public $permission;
70
71 /**
72 * Permission Operator
73 *
74 * @var string
75 */
76 public $permission_operator;
77
78 /**
79 * fullscreen url for dashlet
80 *
81 * @var string
82 */
83 public $fullscreen_url;
84
85 /**
86 * Is this dashlet active?
87 *
88 * @var bool
89 */
90 public $is_active;
91
92 /**
93 * Is this dashlet reserved?
94 *
95 * @var bool
96 */
97 public $is_reserved;
98
99 /**
100 * Number of minutes to cache dashlet content in browser localStorage.
101 *
102 * @var int
103 */
104 public $cache_minutes;
105
106 /**
107 * Class constructor.
108 */
109 public function __construct() {
110 $this->__table = 'civicrm_dashboard';
111 parent::__construct();
112 }
113
114 /**
115 * Returns localized title of this entity.
116 */
117 public static function getEntityTitle() {
118 return ts('Dashboards');
119 }
120
121 /**
122 * Returns foreign keys and entity references.
123 *
124 * @return array
125 * [CRM_Core_Reference_Interface]
126 */
127 public static function getReferenceColumns() {
128 if (!isset(Civi::$statics[__CLASS__]['links'])) {
129 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
130 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id');
131 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
132 }
133 return Civi::$statics[__CLASS__]['links'];
134 }
135
136 /**
137 * Returns all the column names of this table
138 *
139 * @return array
140 */
141 public static function &fields() {
142 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
143 Civi::$statics[__CLASS__]['fields'] = [
144 'id' => [
145 'name' => 'id',
146 'type' => CRM_Utils_Type::T_INT,
147 'title' => ts('DashletID'),
148 'required' => TRUE,
149 'where' => 'civicrm_dashboard.id',
150 'table_name' => 'civicrm_dashboard',
151 'entity' => 'Dashboard',
152 'bao' => 'CRM_Core_BAO_Dashboard',
153 'localizable' => 0,
154 'add' => '3.1',
155 ],
156 'domain_id' => [
157 'name' => 'domain_id',
158 'type' => CRM_Utils_Type::T_INT,
159 'title' => ts('Dashlet Domain'),
160 'description' => ts('Domain for dashboard'),
161 'required' => TRUE,
162 'where' => 'civicrm_dashboard.domain_id',
163 'table_name' => 'civicrm_dashboard',
164 'entity' => 'Dashboard',
165 'bao' => 'CRM_Core_BAO_Dashboard',
166 'localizable' => 0,
167 'FKClassName' => 'CRM_Core_DAO_Domain',
168 'pseudoconstant' => [
169 'table' => 'civicrm_domain',
170 'keyColumn' => 'id',
171 'labelColumn' => 'name',
172 ],
173 'add' => '3.1',
174 ],
175 'name' => [
176 'name' => 'name',
177 'type' => CRM_Utils_Type::T_STRING,
178 'title' => ts('Dashlet Name'),
179 'description' => ts('Internal name of dashlet.'),
180 'maxlength' => 64,
181 'size' => CRM_Utils_Type::BIG,
182 'where' => 'civicrm_dashboard.name',
183 'table_name' => 'civicrm_dashboard',
184 'entity' => 'Dashboard',
185 'bao' => 'CRM_Core_BAO_Dashboard',
186 'localizable' => 0,
187 'add' => '4.4',
188 ],
189 'label' => [
190 'name' => 'label',
191 'type' => CRM_Utils_Type::T_STRING,
192 'title' => ts('Dashlet Title'),
193 'description' => ts('dashlet title'),
194 'maxlength' => 255,
195 'size' => CRM_Utils_Type::HUGE,
196 'where' => 'civicrm_dashboard.label',
197 'table_name' => 'civicrm_dashboard',
198 'entity' => 'Dashboard',
199 'bao' => 'CRM_Core_BAO_Dashboard',
200 'localizable' => 1,
201 'add' => '3.1',
202 ],
203 'url' => [
204 'name' => 'url',
205 'type' => CRM_Utils_Type::T_STRING,
206 'title' => ts('Dashlet URL'),
207 'description' => ts('url in case of external dashlet'),
208 'maxlength' => 255,
209 'size' => CRM_Utils_Type::HUGE,
210 'where' => 'civicrm_dashboard.url',
211 'table_name' => 'civicrm_dashboard',
212 'entity' => 'Dashboard',
213 'bao' => 'CRM_Core_BAO_Dashboard',
214 'localizable' => 0,
215 'add' => '3.1',
216 ],
217 'permission' => [
218 'name' => 'permission',
219 'type' => CRM_Utils_Type::T_STRING,
220 'title' => ts('Dashlet Permission'),
221 'description' => ts('Permission for the dashlet'),
222 'maxlength' => 255,
223 'size' => CRM_Utils_Type::HUGE,
224 'where' => 'civicrm_dashboard.permission',
225 'table_name' => 'civicrm_dashboard',
226 'entity' => 'Dashboard',
227 'bao' => 'CRM_Core_BAO_Dashboard',
228 'localizable' => 0,
229 'serialize' => self::SERIALIZE_COMMA,
230 'add' => '3.1',
231 ],
232 'permission_operator' => [
233 'name' => 'permission_operator',
234 'type' => CRM_Utils_Type::T_STRING,
235 'title' => ts('Dashlet Permission Operator'),
236 'description' => ts('Permission Operator'),
237 'maxlength' => 3,
238 'size' => CRM_Utils_Type::FOUR,
239 'where' => 'civicrm_dashboard.permission_operator',
240 'table_name' => 'civicrm_dashboard',
241 'entity' => 'Dashboard',
242 'bao' => 'CRM_Core_BAO_Dashboard',
243 'localizable' => 0,
244 'add' => '3.1',
245 ],
246 'fullscreen_url' => [
247 'name' => 'fullscreen_url',
248 'type' => CRM_Utils_Type::T_STRING,
249 'title' => ts('Fullscreen URL'),
250 'description' => ts('fullscreen url for dashlet'),
251 'maxlength' => 255,
252 'size' => CRM_Utils_Type::HUGE,
253 'where' => 'civicrm_dashboard.fullscreen_url',
254 'table_name' => 'civicrm_dashboard',
255 'entity' => 'Dashboard',
256 'bao' => 'CRM_Core_BAO_Dashboard',
257 'localizable' => 0,
258 'add' => '3.4',
259 ],
260 'is_active' => [
261 'name' => 'is_active',
262 'type' => CRM_Utils_Type::T_BOOLEAN,
263 'title' => ts('Is Dashlet Active?'),
264 'description' => ts('Is this dashlet active?'),
265 'where' => 'civicrm_dashboard.is_active',
266 'default' => '0',
267 'table_name' => 'civicrm_dashboard',
268 'entity' => 'Dashboard',
269 'bao' => 'CRM_Core_BAO_Dashboard',
270 'localizable' => 0,
271 'add' => '3.1',
272 ],
273 'is_reserved' => [
274 'name' => 'is_reserved',
275 'type' => CRM_Utils_Type::T_BOOLEAN,
276 'title' => ts('Is Dashlet Reserved?'),
277 'description' => ts('Is this dashlet reserved?'),
278 'where' => 'civicrm_dashboard.is_reserved',
279 'default' => '0',
280 'table_name' => 'civicrm_dashboard',
281 'entity' => 'Dashboard',
282 'bao' => 'CRM_Core_BAO_Dashboard',
283 'localizable' => 0,
284 'add' => '3.1',
285 ],
286 'cache_minutes' => [
287 'name' => 'cache_minutes',
288 'type' => CRM_Utils_Type::T_INT,
289 'title' => ts('Cache Minutes'),
290 'description' => ts('Number of minutes to cache dashlet content in browser localStorage.'),
291 'required' => TRUE,
292 'where' => 'civicrm_dashboard.cache_minutes',
293 'default' => '60',
294 'table_name' => 'civicrm_dashboard',
295 'entity' => 'Dashboard',
296 'bao' => 'CRM_Core_BAO_Dashboard',
297 'localizable' => 0,
298 'add' => '4.7',
299 ],
300 ];
301 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
302 }
303 return Civi::$statics[__CLASS__]['fields'];
304 }
305
306 /**
307 * Return a mapping from field-name to the corresponding key (as used in fields()).
308 *
309 * @return array
310 * Array(string $name => string $uniqueName).
311 */
312 public static function &fieldKeys() {
313 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
314 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
315 }
316 return Civi::$statics[__CLASS__]['fieldKeys'];
317 }
318
319 /**
320 * Returns the names of this table
321 *
322 * @return string
323 */
324 public static function getTableName() {
325 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
326 }
327
328 /**
329 * Returns if this table needs to be logged
330 *
331 * @return bool
332 */
333 public function getLog() {
334 return self::$_log;
335 }
336
337 /**
338 * Returns the list of fields that can be imported
339 *
340 * @param bool $prefix
341 *
342 * @return array
343 */
344 public static function &import($prefix = FALSE) {
345 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'dashboard', $prefix, []);
346 return $r;
347 }
348
349 /**
350 * Returns the list of fields that can be exported
351 *
352 * @param bool $prefix
353 *
354 * @return array
355 */
356 public static function &export($prefix = FALSE) {
357 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'dashboard', $prefix, []);
358 return $r;
359 }
360
361 /**
362 * Returns the list of indices
363 *
364 * @param bool $localize
365 *
366 * @return array
367 */
368 public static function indices($localize = TRUE) {
369 $indices = [];
370 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
371 }
372
373 }