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:262213759ac6f4c9943f4ebd454256ae)
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;
111 public function __construct() {
112 $this->__table
= 'civicrm_dashboard';
113 parent
::__construct();
117 * Returns localized title of this entity.
119 * @param bool $plural
120 * Whether to return the plural version of the title.
122 public static function getEntityTitle($plural = FALSE) {
123 return $plural ?
ts('Dashboards') : ts('Dashboard');
127 * Returns foreign keys and entity references.
130 * [CRM_Core_Reference_Interface]
132 public static function getReferenceColumns() {
133 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
134 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
135 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
136 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
138 return Civi
::$statics[__CLASS__
]['links'];
142 * Returns all the column names of this table
146 public static function &fields() {
147 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
148 Civi
::$statics[__CLASS__
]['fields'] = [
151 'type' => CRM_Utils_Type
::T_INT
,
152 'title' => ts('DashletID'),
154 'where' => 'civicrm_dashboard.id',
155 'table_name' => 'civicrm_dashboard',
156 'entity' => 'Dashboard',
157 'bao' => 'CRM_Core_BAO_Dashboard',
162 'name' => 'domain_id',
163 'type' => CRM_Utils_Type
::T_INT
,
164 'title' => ts('Dashlet Domain'),
165 'description' => ts('Domain for dashboard'),
167 'where' => 'civicrm_dashboard.domain_id',
168 'table_name' => 'civicrm_dashboard',
169 'entity' => 'Dashboard',
170 'bao' => 'CRM_Core_BAO_Dashboard',
172 'FKClassName' => 'CRM_Core_DAO_Domain',
173 'pseudoconstant' => [
174 'table' => 'civicrm_domain',
176 'labelColumn' => 'name',
182 'type' => CRM_Utils_Type
::T_STRING
,
183 'title' => ts('Dashlet Name'),
184 'description' => ts('Internal name of dashlet.'),
186 'size' => CRM_Utils_Type
::BIG
,
187 'where' => 'civicrm_dashboard.name',
188 'table_name' => 'civicrm_dashboard',
189 'entity' => 'Dashboard',
190 'bao' => 'CRM_Core_BAO_Dashboard',
196 'type' => CRM_Utils_Type
::T_STRING
,
197 'title' => ts('Dashlet Title'),
198 'description' => ts('dashlet title'),
200 'size' => CRM_Utils_Type
::HUGE
,
201 'where' => 'civicrm_dashboard.label',
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 URL'),
212 'description' => ts('url in case of external dashlet'),
214 'size' => CRM_Utils_Type
::HUGE
,
215 'where' => 'civicrm_dashboard.url',
216 'table_name' => 'civicrm_dashboard',
217 'entity' => 'Dashboard',
218 'bao' => 'CRM_Core_BAO_Dashboard',
223 'name' => 'permission',
224 'type' => CRM_Utils_Type
::T_STRING
,
225 'title' => ts('Dashlet Permission'),
226 'description' => ts('Permission for the dashlet'),
228 'size' => CRM_Utils_Type
::HUGE
,
229 'where' => 'civicrm_dashboard.permission',
230 'table_name' => 'civicrm_dashboard',
231 'entity' => 'Dashboard',
232 'bao' => 'CRM_Core_BAO_Dashboard',
234 'serialize' => self
::SERIALIZE_COMMA
,
237 'permission_operator' => [
238 'name' => 'permission_operator',
239 'type' => CRM_Utils_Type
::T_STRING
,
240 'title' => ts('Dashlet Permission Operator'),
241 'description' => ts('Permission Operator'),
243 'size' => CRM_Utils_Type
::FOUR
,
244 'where' => 'civicrm_dashboard.permission_operator',
245 'table_name' => 'civicrm_dashboard',
246 'entity' => 'Dashboard',
247 'bao' => 'CRM_Core_BAO_Dashboard',
251 'fullscreen_url' => [
252 'name' => 'fullscreen_url',
253 'type' => CRM_Utils_Type
::T_STRING
,
254 'title' => ts('Fullscreen URL'),
255 'description' => ts('fullscreen url for dashlet'),
257 'size' => CRM_Utils_Type
::HUGE
,
258 'where' => 'civicrm_dashboard.fullscreen_url',
259 'table_name' => 'civicrm_dashboard',
260 'entity' => 'Dashboard',
261 'bao' => 'CRM_Core_BAO_Dashboard',
266 'name' => 'is_active',
267 'type' => CRM_Utils_Type
::T_BOOLEAN
,
268 'title' => ts('Is Dashlet Active?'),
269 'description' => ts('Is this dashlet active?'),
270 'where' => 'civicrm_dashboard.is_active',
272 'table_name' => 'civicrm_dashboard',
273 'entity' => 'Dashboard',
274 'bao' => 'CRM_Core_BAO_Dashboard',
279 'name' => 'is_reserved',
280 'type' => CRM_Utils_Type
::T_BOOLEAN
,
281 'title' => ts('Is Dashlet Reserved?'),
282 'description' => ts('Is this dashlet reserved?'),
283 'where' => 'civicrm_dashboard.is_reserved',
285 'table_name' => 'civicrm_dashboard',
286 'entity' => 'Dashboard',
287 'bao' => 'CRM_Core_BAO_Dashboard',
292 'name' => 'cache_minutes',
293 'type' => CRM_Utils_Type
::T_INT
,
294 'title' => ts('Cache Minutes'),
295 'description' => ts('Number of minutes to cache dashlet content in browser localStorage.'),
297 'where' => 'civicrm_dashboard.cache_minutes',
299 'table_name' => 'civicrm_dashboard',
300 'entity' => 'Dashboard',
301 'bao' => 'CRM_Core_BAO_Dashboard',
306 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
308 return Civi
::$statics[__CLASS__
]['fields'];
312 * Return a mapping from field-name to the corresponding key (as used in fields()).
315 * Array(string $name => string $uniqueName).
317 public static function &fieldKeys() {
318 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
319 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
321 return Civi
::$statics[__CLASS__
]['fieldKeys'];
325 * Returns the names of this table
329 public static function getTableName() {
330 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
334 * Returns if this table needs to be logged
338 public function getLog() {
343 * Returns the list of fields that can be imported
345 * @param bool $prefix
349 public static function &import($prefix = FALSE) {
350 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dashboard', $prefix, []);
355 * Returns the list of fields that can be exported
357 * @param bool $prefix
361 public static function &export($prefix = FALSE) {
362 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dashboard', $prefix, []);
367 * Returns the list of indices
369 * @param bool $localize
373 public static function indices($localize = TRUE) {
375 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;