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