5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/Dashboard.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:c93931e695d897a5f4ad92e388748424)
13 * Database access object for the Dashboard entity.
15 class CRM_Core_DAO_Dashboard
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '3.1';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_dashboard';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
34 * @var int|string|null
35 * (SQL type: int unsigned)
36 * Note that values will be retrieved from the database as a string.
41 * Domain for dashboard
44 * (SQL type: int unsigned)
45 * Note that values will be retrieved from the database as a string.
50 * Internal name of dashlet.
53 * (SQL type: varchar(64))
54 * Note that values will be retrieved from the database as a string.
62 * (SQL type: varchar(255))
63 * Note that values will be retrieved from the database as a string.
68 * url in case of external dashlet
71 * (SQL type: varchar(255))
72 * Note that values will be retrieved from the database as a string.
77 * Permission for the dashlet
80 * (SQL type: varchar(255))
81 * Note that values will be retrieved from the database as a string.
89 * (SQL type: varchar(3))
90 * Note that values will be retrieved from the database as a string.
92 public $permission_operator;
95 * fullscreen url for dashlet
98 * (SQL type: varchar(255))
99 * Note that values will be retrieved from the database as a string.
101 public $fullscreen_url;
104 * Is this dashlet active?
106 * @var bool|string|null
107 * (SQL type: tinyint)
108 * Note that values will be retrieved from the database as a string.
113 * Is this dashlet reserved?
115 * @var bool|string|null
116 * (SQL type: tinyint)
117 * Note that values will be retrieved from the database as a string.
122 * Number of minutes to cache dashlet content in browser localStorage.
125 * (SQL type: int unsigned)
126 * Note that values will be retrieved from the database as a string.
128 public $cache_minutes;
131 * Element name of angular directive to invoke (lowercase hyphenated format)
134 * (SQL type: varchar(255))
135 * Note that values will be retrieved from the database as a string.
142 public function __construct() {
143 $this->__table
= 'civicrm_dashboard';
144 parent
::__construct();
148 * Returns localized title of this entity.
150 * @param bool $plural
151 * Whether to return the plural version of the title.
153 public static function getEntityTitle($plural = FALSE) {
154 return $plural ?
ts('Dashboards') : ts('Dashboard');
158 * Returns foreign keys and entity references.
161 * [CRM_Core_Reference_Interface]
163 public static function getReferenceColumns() {
164 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
165 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
166 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
167 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
169 return Civi
::$statics[__CLASS__
]['links'];
173 * Returns all the column names of this table
177 public static function &fields() {
178 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
179 Civi
::$statics[__CLASS__
]['fields'] = [
182 'type' => CRM_Utils_Type
::T_INT
,
183 'title' => ts('DashletID'),
185 'where' => 'civicrm_dashboard.id',
186 'table_name' => 'civicrm_dashboard',
187 'entity' => 'Dashboard',
188 'bao' => 'CRM_Core_BAO_Dashboard',
197 'name' => 'domain_id',
198 'type' => CRM_Utils_Type
::T_INT
,
199 'title' => ts('Domain ID'),
200 'description' => ts('Domain for dashboard'),
202 'where' => 'civicrm_dashboard.domain_id',
203 'table_name' => 'civicrm_dashboard',
204 'entity' => 'Dashboard',
205 'bao' => 'CRM_Core_BAO_Dashboard',
207 'FKClassName' => 'CRM_Core_DAO_Domain',
209 'label' => ts("Domain"),
211 'pseudoconstant' => [
212 'table' => 'civicrm_domain',
214 'labelColumn' => 'name',
220 'type' => CRM_Utils_Type
::T_STRING
,
221 'title' => ts('Dashlet Name'),
222 'description' => ts('Internal name of dashlet.'),
224 'size' => CRM_Utils_Type
::BIG
,
225 'where' => 'civicrm_dashboard.name',
226 'table_name' => 'civicrm_dashboard',
227 'entity' => 'Dashboard',
228 'bao' => 'CRM_Core_BAO_Dashboard',
234 'type' => CRM_Utils_Type
::T_STRING
,
235 'title' => ts('Dashlet Title'),
236 'description' => ts('dashlet title'),
238 'size' => CRM_Utils_Type
::HUGE
,
239 'where' => 'civicrm_dashboard.label',
240 'table_name' => 'civicrm_dashboard',
241 'entity' => 'Dashboard',
242 'bao' => 'CRM_Core_BAO_Dashboard',
248 'type' => CRM_Utils_Type
::T_STRING
,
249 'title' => ts('Dashlet URL'),
250 'description' => ts('url in case of external dashlet'),
252 'size' => CRM_Utils_Type
::HUGE
,
253 'where' => 'civicrm_dashboard.url',
254 'table_name' => 'civicrm_dashboard',
255 'entity' => 'Dashboard',
256 'bao' => 'CRM_Core_BAO_Dashboard',
261 'name' => 'permission',
262 'type' => CRM_Utils_Type
::T_STRING
,
263 'title' => ts('Dashlet Permission'),
264 'description' => ts('Permission for the dashlet'),
266 'size' => CRM_Utils_Type
::HUGE
,
267 'where' => 'civicrm_dashboard.permission',
268 'table_name' => 'civicrm_dashboard',
269 'entity' => 'Dashboard',
270 'bao' => 'CRM_Core_BAO_Dashboard',
272 'serialize' => self
::SERIALIZE_COMMA
,
275 'permission_operator' => [
276 'name' => 'permission_operator',
277 'type' => CRM_Utils_Type
::T_STRING
,
278 'title' => ts('Dashlet Permission Operator'),
279 'description' => ts('Permission Operator'),
281 'size' => CRM_Utils_Type
::FOUR
,
282 'where' => 'civicrm_dashboard.permission_operator',
283 'table_name' => 'civicrm_dashboard',
284 'entity' => 'Dashboard',
285 'bao' => 'CRM_Core_BAO_Dashboard',
287 'pseudoconstant' => [
288 'callback' => 'CRM_Core_SelectValues::andOr',
292 'fullscreen_url' => [
293 'name' => 'fullscreen_url',
294 'type' => CRM_Utils_Type
::T_STRING
,
295 'title' => ts('Fullscreen URL'),
296 'description' => ts('fullscreen url for dashlet'),
298 'size' => CRM_Utils_Type
::HUGE
,
299 'where' => 'civicrm_dashboard.fullscreen_url',
300 'table_name' => 'civicrm_dashboard',
301 'entity' => 'Dashboard',
302 'bao' => 'CRM_Core_BAO_Dashboard',
307 'name' => 'is_active',
308 'type' => CRM_Utils_Type
::T_BOOLEAN
,
309 'title' => ts('Is Dashlet Active?'),
310 'description' => ts('Is this dashlet active?'),
311 'where' => 'civicrm_dashboard.is_active',
313 'table_name' => 'civicrm_dashboard',
314 'entity' => 'Dashboard',
315 'bao' => 'CRM_Core_BAO_Dashboard',
320 'name' => 'is_reserved',
321 'type' => CRM_Utils_Type
::T_BOOLEAN
,
322 'title' => ts('Is Dashlet Reserved?'),
323 'description' => ts('Is this dashlet reserved?'),
324 'where' => 'civicrm_dashboard.is_reserved',
326 'table_name' => 'civicrm_dashboard',
327 'entity' => 'Dashboard',
328 'bao' => 'CRM_Core_BAO_Dashboard',
333 'name' => 'cache_minutes',
334 'type' => CRM_Utils_Type
::T_INT
,
335 'title' => ts('Cache Minutes'),
336 'description' => ts('Number of minutes to cache dashlet content in browser localStorage.'),
338 'where' => 'civicrm_dashboard.cache_minutes',
340 'table_name' => 'civicrm_dashboard',
341 'entity' => 'Dashboard',
342 'bao' => 'CRM_Core_BAO_Dashboard',
347 'name' => 'directive',
348 'type' => CRM_Utils_Type
::T_STRING
,
349 'title' => ts('Angular directive'),
350 'description' => ts('Element name of angular directive to invoke (lowercase hyphenated format)'),
352 'size' => CRM_Utils_Type
::HUGE
,
353 'where' => 'civicrm_dashboard.directive',
354 'table_name' => 'civicrm_dashboard',
355 'entity' => 'Dashboard',
356 'bao' => 'CRM_Core_BAO_Dashboard',
361 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
363 return Civi
::$statics[__CLASS__
]['fields'];
367 * Return a mapping from field-name to the corresponding key (as used in fields()).
370 * Array(string $name => string $uniqueName).
372 public static function &fieldKeys() {
373 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
374 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
376 return Civi
::$statics[__CLASS__
]['fieldKeys'];
380 * Returns the names of this table
384 public static function getTableName() {
385 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
389 * Returns if this table needs to be logged
393 public function getLog() {
398 * Returns the list of fields that can be imported
400 * @param bool $prefix
404 public static function &import($prefix = FALSE) {
405 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dashboard', $prefix, []);
410 * Returns the list of fields that can be exported
412 * @param bool $prefix
416 public static function &export($prefix = FALSE) {
417 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dashboard', $prefix, []);
422 * Returns the list of indices
424 * @param bool $localize
428 public static function indices($localize = TRUE) {
430 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;