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:9603ee2a3a27196ef1ec671bf758a783)
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;
39 * Domain for dashboard
46 * Internal name of dashlet.
60 * url in case of external dashlet
67 * Permission for the dashlet
78 public $permission_operator;
81 * fullscreen url for dashlet
85 public $fullscreen_url;
88 * Is this dashlet active?
95 * Is this dashlet reserved?
102 * Number of minutes to cache dashlet content in browser localStorage.
106 public $cache_minutes;
109 * Element name of angular directive to invoke (lowercase hyphenated format)
118 public function __construct() {
119 $this->__table
= 'civicrm_dashboard';
120 parent
::__construct();
124 * Returns localized title of this entity.
126 * @param bool $plural
127 * Whether to return the plural version of the title.
129 public static function getEntityTitle($plural = FALSE) {
130 return $plural ?
ts('Dashboards') : ts('Dashboard');
134 * Returns foreign keys and entity references.
137 * [CRM_Core_Reference_Interface]
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']);
145 return Civi
::$statics[__CLASS__
]['links'];
149 * Returns all the column names of this table
153 public static function &fields() {
154 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
155 Civi
::$statics[__CLASS__
]['fields'] = [
158 'type' => CRM_Utils_Type
::T_INT
,
159 'title' => ts('DashletID'),
161 'where' => 'civicrm_dashboard.id',
162 'table_name' => 'civicrm_dashboard',
163 'entity' => 'Dashboard',
164 'bao' => 'CRM_Core_BAO_Dashboard',
173 'name' => 'domain_id',
174 'type' => CRM_Utils_Type
::T_INT
,
175 'title' => ts('Domain ID'),
176 'description' => ts('Domain for dashboard'),
178 'where' => 'civicrm_dashboard.domain_id',
179 'table_name' => 'civicrm_dashboard',
180 'entity' => 'Dashboard',
181 'bao' => 'CRM_Core_BAO_Dashboard',
183 'FKClassName' => 'CRM_Core_DAO_Domain',
185 'label' => ts("Domain"),
187 'pseudoconstant' => [
188 'table' => 'civicrm_domain',
190 'labelColumn' => 'name',
196 'type' => CRM_Utils_Type
::T_STRING
,
197 'title' => ts('Dashlet Name'),
198 'description' => ts('Internal name of dashlet.'),
200 'size' => CRM_Utils_Type
::BIG
,
201 'where' => 'civicrm_dashboard.name',
202 'table_name' => 'civicrm_dashboard',
203 'entity' => 'Dashboard',
204 'bao' => 'CRM_Core_BAO_Dashboard',
210 'type' => CRM_Utils_Type
::T_STRING
,
211 'title' => ts('Dashlet Title'),
212 'description' => ts('dashlet title'),
214 'size' => CRM_Utils_Type
::HUGE
,
215 'where' => 'civicrm_dashboard.label',
216 'table_name' => 'civicrm_dashboard',
217 'entity' => 'Dashboard',
218 'bao' => 'CRM_Core_BAO_Dashboard',
224 'type' => CRM_Utils_Type
::T_STRING
,
225 'title' => ts('Dashlet URL'),
226 'description' => ts('url in case of external dashlet'),
228 'size' => CRM_Utils_Type
::HUGE
,
229 'where' => 'civicrm_dashboard.url',
230 'table_name' => 'civicrm_dashboard',
231 'entity' => 'Dashboard',
232 'bao' => 'CRM_Core_BAO_Dashboard',
237 'name' => 'permission',
238 'type' => CRM_Utils_Type
::T_STRING
,
239 'title' => ts('Dashlet Permission'),
240 'description' => ts('Permission for the dashlet'),
242 'size' => CRM_Utils_Type
::HUGE
,
243 'where' => 'civicrm_dashboard.permission',
244 'table_name' => 'civicrm_dashboard',
245 'entity' => 'Dashboard',
246 'bao' => 'CRM_Core_BAO_Dashboard',
248 'serialize' => self
::SERIALIZE_COMMA
,
251 'permission_operator' => [
252 'name' => 'permission_operator',
253 'type' => CRM_Utils_Type
::T_STRING
,
254 'title' => ts('Dashlet Permission Operator'),
255 'description' => ts('Permission Operator'),
257 'size' => CRM_Utils_Type
::FOUR
,
258 'where' => 'civicrm_dashboard.permission_operator',
259 'table_name' => 'civicrm_dashboard',
260 'entity' => 'Dashboard',
261 'bao' => 'CRM_Core_BAO_Dashboard',
263 'pseudoconstant' => [
264 'callback' => 'CRM_Core_SelectValues::andOr',
268 'fullscreen_url' => [
269 'name' => 'fullscreen_url',
270 'type' => CRM_Utils_Type
::T_STRING
,
271 'title' => ts('Fullscreen URL'),
272 'description' => ts('fullscreen url for dashlet'),
274 'size' => CRM_Utils_Type
::HUGE
,
275 'where' => 'civicrm_dashboard.fullscreen_url',
276 'table_name' => 'civicrm_dashboard',
277 'entity' => 'Dashboard',
278 'bao' => 'CRM_Core_BAO_Dashboard',
283 'name' => 'is_active',
284 'type' => CRM_Utils_Type
::T_BOOLEAN
,
285 'title' => ts('Is Dashlet Active?'),
286 'description' => ts('Is this dashlet active?'),
287 'where' => 'civicrm_dashboard.is_active',
289 'table_name' => 'civicrm_dashboard',
290 'entity' => 'Dashboard',
291 'bao' => 'CRM_Core_BAO_Dashboard',
296 'name' => 'is_reserved',
297 'type' => CRM_Utils_Type
::T_BOOLEAN
,
298 'title' => ts('Is Dashlet Reserved?'),
299 'description' => ts('Is this dashlet reserved?'),
300 'where' => 'civicrm_dashboard.is_reserved',
302 'table_name' => 'civicrm_dashboard',
303 'entity' => 'Dashboard',
304 'bao' => 'CRM_Core_BAO_Dashboard',
309 'name' => 'cache_minutes',
310 'type' => CRM_Utils_Type
::T_INT
,
311 'title' => ts('Cache Minutes'),
312 'description' => ts('Number of minutes to cache dashlet content in browser localStorage.'),
314 'where' => 'civicrm_dashboard.cache_minutes',
316 'table_name' => 'civicrm_dashboard',
317 'entity' => 'Dashboard',
318 'bao' => 'CRM_Core_BAO_Dashboard',
323 'name' => 'directive',
324 'type' => CRM_Utils_Type
::T_STRING
,
325 'title' => ts('Angular directive'),
326 'description' => ts('Element name of angular directive to invoke (lowercase hyphenated format)'),
328 'size' => CRM_Utils_Type
::HUGE
,
329 'where' => 'civicrm_dashboard.directive',
330 'table_name' => 'civicrm_dashboard',
331 'entity' => 'Dashboard',
332 'bao' => 'CRM_Core_BAO_Dashboard',
337 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
339 return Civi
::$statics[__CLASS__
]['fields'];
343 * Return a mapping from field-name to the corresponding key (as used in fields()).
346 * Array(string $name => string $uniqueName).
348 public static function &fieldKeys() {
349 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
350 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
352 return Civi
::$statics[__CLASS__
]['fieldKeys'];
356 * Returns the names of this table
360 public static function getTableName() {
361 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
365 * Returns if this table needs to be logged
369 public function getLog() {
374 * Returns the list of fields that can be imported
376 * @param bool $prefix
380 public static function &import($prefix = FALSE) {
381 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dashboard', $prefix, []);
386 * Returns the list of fields that can be exported
388 * @param bool $prefix
392 public static function &export($prefix = FALSE) {
393 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dashboard', $prefix, []);
398 * Returns the list of indices
400 * @param bool $localize
404 public static function indices($localize = TRUE) {
406 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;