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