Merge pull request #12925 from eileenmcnaughton/setting
[civicrm-core.git] / CRM / Core / DAO / Dashboard.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
8c9251b3 5 * @copyright CiviCRM LLC (c) 2004-2018
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Core/Dashboard.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
6a7e5e5d 9 * (GenCodeChecksum:6b7454609bac684a5d32597cdd433f3d)
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 */
22 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 */
c3fc2621
CW
29 static $_log = FALSE;
30
e501603b 31 /**
e501603b
TO
32 * @var int unsigned
33 */
34 public $id;
c3fc2621 35
e501603b
TO
36 /**
37 * Domain for dashboard
38 *
39 * @var int unsigned
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 *
88 * @var boolean
89 */
90 public $is_active;
c3fc2621 91
e501603b
TO
92 /**
93 * Is this dashlet reserved?
94 *
95 * @var boolean
96 */
97 public $is_reserved;
c3fc2621 98
e501603b 99 /**
bf7df0ec 100 * Number of minutes to cache dashlet content in browser localStorage.
e501603b 101 *
bf7df0ec 102 * @var int unsigned
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
e501603b 114 /**
f41f0342 115 * Returns foreign keys and entity references.
e501603b
TO
116 *
117 * @return array
118 * [CRM_Core_Reference_Interface]
119 */
c3fc2621 120 public static function getReferenceColumns() {
346aaaba
TO
121 if (!isset(Civi::$statics[__CLASS__]['links'])) {
122 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
c3fc2621 123 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id');
346aaaba 124 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 125 }
346aaaba 126 return Civi::$statics[__CLASS__]['links'];
e501603b 127 }
c3fc2621 128
e501603b
TO
129 /**
130 * Returns all the column names of this table
131 *
132 * @return array
133 */
c3fc2621 134 public static function &fields() {
346aaaba 135 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
136 Civi::$statics[__CLASS__]['fields'] = [
137 'id' => [
e501603b
TO
138 'name' => 'id',
139 'type' => CRM_Utils_Type::T_INT,
c3fc2621
CW
140 'title' => ts('DashletID'),
141 'required' => TRUE,
522a26c9 142 'table_name' => 'civicrm_dashboard',
143 'entity' => 'Dashboard',
144 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 145 'localizable' => 0,
c3fc2621
CW
146 ],
147 'domain_id' => [
e501603b
TO
148 'name' => 'domain_id',
149 'type' => CRM_Utils_Type::T_INT,
c3fc2621 150 'title' => ts('Dashlet Domain'),
e501603b 151 'description' => 'Domain for dashboard',
c3fc2621 152 'required' => TRUE,
522a26c9 153 'table_name' => 'civicrm_dashboard',
154 'entity' => 'Dashboard',
155 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 156 'localizable' => 0,
e501603b 157 'FKClassName' => 'CRM_Core_DAO_Domain',
c3fc2621 158 'pseudoconstant' => [
e501603b
TO
159 'table' => 'civicrm_domain',
160 'keyColumn' => 'id',
161 'labelColumn' => 'name',
c3fc2621
CW
162 ]
163 ],
164 'name' => [
e501603b
TO
165 'name' => 'name',
166 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 167 'title' => ts('Dashlet Name'),
e501603b
TO
168 'description' => 'Internal name of dashlet.',
169 'maxlength' => 64,
170 'size' => CRM_Utils_Type::BIG,
522a26c9 171 'table_name' => 'civicrm_dashboard',
172 'entity' => 'Dashboard',
173 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 174 'localizable' => 0,
c3fc2621
CW
175 ],
176 'label' => [
e501603b
TO
177 'name' => 'label',
178 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 179 'title' => ts('Dashlet Title'),
e501603b
TO
180 'description' => 'dashlet title',
181 'maxlength' => 255,
182 'size' => CRM_Utils_Type::HUGE,
522a26c9 183 'table_name' => 'civicrm_dashboard',
184 'entity' => 'Dashboard',
185 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 186 'localizable' => 1,
c3fc2621
CW
187 ],
188 'url' => [
e501603b
TO
189 'name' => 'url',
190 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 191 'title' => ts('Dashlet URL'),
e501603b
TO
192 'description' => 'url in case of external dashlet',
193 'maxlength' => 255,
194 'size' => CRM_Utils_Type::HUGE,
522a26c9 195 'table_name' => 'civicrm_dashboard',
196 'entity' => 'Dashboard',
197 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 198 'localizable' => 0,
c3fc2621
CW
199 ],
200 'permission' => [
e501603b
TO
201 'name' => 'permission',
202 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 203 'title' => ts('Dashlet Permission'),
e501603b
TO
204 'description' => 'Permission for the dashlet',
205 'maxlength' => 255,
206 'size' => CRM_Utils_Type::HUGE,
522a26c9 207 'table_name' => 'civicrm_dashboard',
208 'entity' => 'Dashboard',
209 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 210 'localizable' => 0,
c3fc2621
CW
211 ],
212 'permission_operator' => [
e501603b
TO
213 'name' => 'permission_operator',
214 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 215 'title' => ts('Dashlet Permission Operator'),
e501603b
TO
216 'description' => 'Permission Operator',
217 'maxlength' => 3,
218 'size' => CRM_Utils_Type::FOUR,
522a26c9 219 'table_name' => 'civicrm_dashboard',
220 'entity' => 'Dashboard',
221 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 222 'localizable' => 0,
c3fc2621
CW
223 ],
224 'fullscreen_url' => [
e501603b
TO
225 'name' => 'fullscreen_url',
226 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 227 'title' => ts('Fullscreen URL'),
e501603b
TO
228 'description' => 'fullscreen url for dashlet',
229 'maxlength' => 255,
230 'size' => CRM_Utils_Type::HUGE,
522a26c9 231 'table_name' => 'civicrm_dashboard',
232 'entity' => 'Dashboard',
233 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 234 'localizable' => 0,
c3fc2621
CW
235 ],
236 'is_active' => [
e501603b
TO
237 'name' => 'is_active',
238 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 239 'title' => ts('Is Dashlet Active?'),
e501603b 240 'description' => 'Is this dashlet active?',
45a83e42 241 'default' => '0',
522a26c9 242 'table_name' => 'civicrm_dashboard',
243 'entity' => 'Dashboard',
244 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 245 'localizable' => 0,
c3fc2621
CW
246 ],
247 'is_reserved' => [
e501603b
TO
248 'name' => 'is_reserved',
249 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 250 'title' => ts('Is Dashlet Reserved?'),
e501603b 251 'description' => 'Is this dashlet reserved?',
45a83e42 252 'default' => '0',
522a26c9 253 'table_name' => 'civicrm_dashboard',
254 'entity' => 'Dashboard',
255 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 256 'localizable' => 0,
c3fc2621
CW
257 ],
258 'cache_minutes' => [
bf7df0ec 259 'name' => 'cache_minutes',
e501603b 260 'type' => CRM_Utils_Type::T_INT,
c3fc2621 261 'title' => ts('Cache Minutes'),
bf7df0ec 262 'description' => 'Number of minutes to cache dashlet content in browser localStorage.',
c3fc2621 263 'required' => TRUE,
bf7df0ec 264 'default' => '60',
522a26c9 265 'table_name' => 'civicrm_dashboard',
266 'entity' => 'Dashboard',
267 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 268 'localizable' => 0,
c3fc2621
CW
269 ],
270 ];
346aaaba 271 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 272 }
346aaaba 273 return Civi::$statics[__CLASS__]['fields'];
e501603b 274 }
c3fc2621 275
e501603b 276 /**
bd8e0b14 277 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
278 *
279 * @return array
bd8e0b14 280 * Array(string $name => string $uniqueName).
e501603b 281 */
c3fc2621 282 public static function &fieldKeys() {
bd8e0b14
TO
283 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
284 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 285 }
bd8e0b14 286 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 287 }
c3fc2621 288
e501603b
TO
289 /**
290 * Returns the names of this table
291 *
292 * @return string
293 */
c3fc2621 294 public static function getTableName() {
e501603b
TO
295 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
296 }
c3fc2621 297
e501603b
TO
298 /**
299 * Returns if this table needs to be logged
300 *
c3fc2621 301 * @return bool
e501603b 302 */
c3fc2621 303 public function getLog() {
e501603b
TO
304 return self::$_log;
305 }
c3fc2621 306
e501603b
TO
307 /**
308 * Returns the list of fields that can be imported
309 *
310 * @param bool $prefix
311 *
312 * @return array
313 */
c3fc2621
CW
314 public static function &import($prefix = FALSE) {
315 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'dashboard', $prefix, []);
60808919 316 return $r;
e501603b 317 }
c3fc2621 318
e501603b
TO
319 /**
320 * Returns the list of fields that can be exported
321 *
322 * @param bool $prefix
323 *
324 * @return array
325 */
c3fc2621
CW
326 public static function &export($prefix = FALSE) {
327 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'dashboard', $prefix, []);
60808919 328 return $r;
e501603b 329 }
c3fc2621 330
e7a6b91a
AS
331 /**
332 * Returns the list of indices
c3fc2621
CW
333 *
334 * @param bool $localize
335 *
336 * @return array
e7a6b91a
AS
337 */
338 public static function indices($localize = TRUE) {
c3fc2621 339 $indices = [];
e7a6b91a
AS
340 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
341 }
c3fc2621 342
e501603b 343}