Commit | Line | Data |
---|---|---|
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 | |
7a19c557 | 9 | * (GenCodeChecksum:06a6051f8aa495ae244afaa0e75aa7e0) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the Dashboard entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class 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 | |
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 | 121 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
fa45b5b9 | 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, | |
a36434b9 | 142 | 'where' => 'civicrm_dashboard.id', |
522a26c9 | 143 | 'table_name' => 'civicrm_dashboard', |
144 | 'entity' => 'Dashboard', | |
145 | 'bao' => 'CRM_Core_BAO_Dashboard', | |
6a7e5e5d | 146 | 'localizable' => 0, |
c3fc2621 CW |
147 | ], |
148 | 'domain_id' => [ | |
e501603b TO |
149 | 'name' => 'domain_id', |
150 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 151 | 'title' => ts('Dashlet Domain'), |
215b423e | 152 | 'description' => ts('Domain for dashboard'), |
c3fc2621 | 153 | 'required' => TRUE, |
a36434b9 | 154 | 'where' => 'civicrm_dashboard.domain_id', |
522a26c9 | 155 | 'table_name' => 'civicrm_dashboard', |
156 | 'entity' => 'Dashboard', | |
157 | 'bao' => 'CRM_Core_BAO_Dashboard', | |
6a7e5e5d | 158 | 'localizable' => 0, |
e501603b | 159 | 'FKClassName' => 'CRM_Core_DAO_Domain', |
c3fc2621 | 160 | 'pseudoconstant' => [ |
e501603b TO |
161 | 'table' => 'civicrm_domain', |
162 | 'keyColumn' => 'id', | |
163 | 'labelColumn' => 'name', | |
e6ca0a57 | 164 | ], |
c3fc2621 CW |
165 | ], |
166 | 'name' => [ | |
e501603b TO |
167 | 'name' => 'name', |
168 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 169 | 'title' => ts('Dashlet Name'), |
215b423e | 170 | 'description' => ts('Internal name of dashlet.'), |
e501603b TO |
171 | 'maxlength' => 64, |
172 | 'size' => CRM_Utils_Type::BIG, | |
a36434b9 | 173 | 'where' => 'civicrm_dashboard.name', |
522a26c9 | 174 | 'table_name' => 'civicrm_dashboard', |
175 | 'entity' => 'Dashboard', | |
176 | 'bao' => 'CRM_Core_BAO_Dashboard', | |
6a7e5e5d | 177 | 'localizable' => 0, |
c3fc2621 CW |
178 | ], |
179 | 'label' => [ | |
e501603b TO |
180 | 'name' => 'label', |
181 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 182 | 'title' => ts('Dashlet Title'), |
215b423e | 183 | 'description' => ts('dashlet title'), |
e501603b TO |
184 | 'maxlength' => 255, |
185 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 186 | 'where' => 'civicrm_dashboard.label', |
522a26c9 | 187 | 'table_name' => 'civicrm_dashboard', |
188 | 'entity' => 'Dashboard', | |
189 | 'bao' => 'CRM_Core_BAO_Dashboard', | |
6a7e5e5d | 190 | 'localizable' => 1, |
c3fc2621 CW |
191 | ], |
192 | 'url' => [ | |
e501603b TO |
193 | 'name' => 'url', |
194 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 195 | 'title' => ts('Dashlet URL'), |
215b423e | 196 | 'description' => ts('url in case of external dashlet'), |
e501603b TO |
197 | 'maxlength' => 255, |
198 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 199 | 'where' => 'civicrm_dashboard.url', |
522a26c9 | 200 | 'table_name' => 'civicrm_dashboard', |
201 | 'entity' => 'Dashboard', | |
202 | 'bao' => 'CRM_Core_BAO_Dashboard', | |
6a7e5e5d | 203 | 'localizable' => 0, |
c3fc2621 CW |
204 | ], |
205 | 'permission' => [ | |
e501603b TO |
206 | 'name' => 'permission', |
207 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 208 | 'title' => ts('Dashlet Permission'), |
215b423e | 209 | 'description' => ts('Permission for the dashlet'), |
e501603b TO |
210 | 'maxlength' => 255, |
211 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 212 | 'where' => 'civicrm_dashboard.permission', |
522a26c9 | 213 | 'table_name' => 'civicrm_dashboard', |
214 | 'entity' => 'Dashboard', | |
215 | 'bao' => 'CRM_Core_BAO_Dashboard', | |
6a7e5e5d | 216 | 'localizable' => 0, |
7a19c557 | 217 | 'serialize' => self::SERIALIZE_COMMA, |
c3fc2621 CW |
218 | ], |
219 | 'permission_operator' => [ | |
e501603b TO |
220 | 'name' => 'permission_operator', |
221 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 222 | 'title' => ts('Dashlet Permission Operator'), |
215b423e | 223 | 'description' => ts('Permission Operator'), |
e501603b TO |
224 | 'maxlength' => 3, |
225 | 'size' => CRM_Utils_Type::FOUR, | |
a36434b9 | 226 | 'where' => 'civicrm_dashboard.permission_operator', |
522a26c9 | 227 | 'table_name' => 'civicrm_dashboard', |
228 | 'entity' => 'Dashboard', | |
229 | 'bao' => 'CRM_Core_BAO_Dashboard', | |
6a7e5e5d | 230 | 'localizable' => 0, |
c3fc2621 CW |
231 | ], |
232 | 'fullscreen_url' => [ | |
e501603b TO |
233 | 'name' => 'fullscreen_url', |
234 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 235 | 'title' => ts('Fullscreen URL'), |
215b423e | 236 | 'description' => ts('fullscreen url for dashlet'), |
e501603b TO |
237 | 'maxlength' => 255, |
238 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 239 | 'where' => 'civicrm_dashboard.fullscreen_url', |
522a26c9 | 240 | 'table_name' => 'civicrm_dashboard', |
241 | 'entity' => 'Dashboard', | |
242 | 'bao' => 'CRM_Core_BAO_Dashboard', | |
6a7e5e5d | 243 | 'localizable' => 0, |
c3fc2621 CW |
244 | ], |
245 | 'is_active' => [ | |
e501603b TO |
246 | 'name' => 'is_active', |
247 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 248 | 'title' => ts('Is Dashlet Active?'), |
215b423e | 249 | 'description' => ts('Is this dashlet active?'), |
a36434b9 | 250 | 'where' => 'civicrm_dashboard.is_active', |
45a83e42 | 251 | 'default' => '0', |
522a26c9 | 252 | 'table_name' => 'civicrm_dashboard', |
253 | 'entity' => 'Dashboard', | |
254 | 'bao' => 'CRM_Core_BAO_Dashboard', | |
6a7e5e5d | 255 | 'localizable' => 0, |
c3fc2621 CW |
256 | ], |
257 | 'is_reserved' => [ | |
e501603b TO |
258 | 'name' => 'is_reserved', |
259 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
c3fc2621 | 260 | 'title' => ts('Is Dashlet Reserved?'), |
215b423e | 261 | 'description' => ts('Is this dashlet reserved?'), |
a36434b9 | 262 | 'where' => 'civicrm_dashboard.is_reserved', |
45a83e42 | 263 | 'default' => '0', |
522a26c9 | 264 | 'table_name' => 'civicrm_dashboard', |
265 | 'entity' => 'Dashboard', | |
266 | 'bao' => 'CRM_Core_BAO_Dashboard', | |
6a7e5e5d | 267 | 'localizable' => 0, |
c3fc2621 CW |
268 | ], |
269 | 'cache_minutes' => [ | |
bf7df0ec | 270 | 'name' => 'cache_minutes', |
e501603b | 271 | 'type' => CRM_Utils_Type::T_INT, |
c3fc2621 | 272 | 'title' => ts('Cache Minutes'), |
215b423e | 273 | 'description' => ts('Number of minutes to cache dashlet content in browser localStorage.'), |
c3fc2621 | 274 | 'required' => TRUE, |
a36434b9 | 275 | 'where' => 'civicrm_dashboard.cache_minutes', |
bf7df0ec | 276 | 'default' => '60', |
522a26c9 | 277 | 'table_name' => 'civicrm_dashboard', |
278 | 'entity' => 'Dashboard', | |
279 | 'bao' => 'CRM_Core_BAO_Dashboard', | |
6a7e5e5d | 280 | 'localizable' => 0, |
c3fc2621 CW |
281 | ], |
282 | ]; | |
346aaaba | 283 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 284 | } |
346aaaba | 285 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 286 | } |
c3fc2621 | 287 | |
e501603b | 288 | /** |
bd8e0b14 | 289 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
290 | * |
291 | * @return array | |
bd8e0b14 | 292 | * Array(string $name => string $uniqueName). |
e501603b | 293 | */ |
c3fc2621 | 294 | public static function &fieldKeys() { |
bd8e0b14 TO |
295 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
296 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 297 | } |
bd8e0b14 | 298 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 299 | } |
c3fc2621 | 300 | |
e501603b TO |
301 | /** |
302 | * Returns the names of this table | |
303 | * | |
304 | * @return string | |
305 | */ | |
c3fc2621 | 306 | public static function getTableName() { |
e501603b TO |
307 | return CRM_Core_DAO::getLocaleTableName(self::$_tableName); |
308 | } | |
c3fc2621 | 309 | |
e501603b TO |
310 | /** |
311 | * Returns if this table needs to be logged | |
312 | * | |
c3fc2621 | 313 | * @return bool |
e501603b | 314 | */ |
c3fc2621 | 315 | public function getLog() { |
e501603b TO |
316 | return self::$_log; |
317 | } | |
c3fc2621 | 318 | |
e501603b TO |
319 | /** |
320 | * Returns the list of fields that can be imported | |
321 | * | |
322 | * @param bool $prefix | |
323 | * | |
324 | * @return array | |
325 | */ | |
c3fc2621 CW |
326 | public static function &import($prefix = FALSE) { |
327 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'dashboard', $prefix, []); | |
60808919 | 328 | return $r; |
e501603b | 329 | } |
c3fc2621 | 330 | |
e501603b TO |
331 | /** |
332 | * Returns the list of fields that can be exported | |
333 | * | |
334 | * @param bool $prefix | |
335 | * | |
336 | * @return array | |
337 | */ | |
c3fc2621 CW |
338 | public static function &export($prefix = FALSE) { |
339 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'dashboard', $prefix, []); | |
60808919 | 340 | return $r; |
e501603b | 341 | } |
c3fc2621 | 342 | |
e7a6b91a AS |
343 | /** |
344 | * Returns the list of indices | |
c3fc2621 CW |
345 | * |
346 | * @param bool $localize | |
347 | * | |
348 | * @return array | |
e7a6b91a AS |
349 | */ |
350 | public static function indices($localize = TRUE) { | |
c3fc2621 | 351 | $indices = []; |
e7a6b91a AS |
352 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
353 | } | |
c3fc2621 | 354 | |
e501603b | 355 | } |