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