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:96e683f4bec8fff387930109c2f5ea41)
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',
169 'name' => 'domain_id',
170 'type' => CRM_Utils_Type
::T_INT
,
171 'title' => ts('Dashlet Domain'),
172 'description' => ts('Domain for dashboard'),
174 'where' => 'civicrm_dashboard.domain_id',
175 'table_name' => 'civicrm_dashboard',
176 'entity' => 'Dashboard',
177 'bao' => 'CRM_Core_BAO_Dashboard',
179 'FKClassName' => 'CRM_Core_DAO_Domain',
180 'pseudoconstant' => [
181 'table' => 'civicrm_domain',
183 'labelColumn' => 'name',
189 'type' => CRM_Utils_Type
::T_STRING
,
190 'title' => ts('Dashlet Name'),
191 'description' => ts('Internal name of dashlet.'),
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',
203 'type' => CRM_Utils_Type
::T_STRING
,
204 'title' => ts('Dashlet Title'),
205 'description' => ts('dashlet title'),
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',
217 'type' => CRM_Utils_Type
::T_STRING
,
218 'title' => ts('Dashlet URL'),
219 'description' => ts('url in case of external dashlet'),
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',
230 'name' => 'permission',
231 'type' => CRM_Utils_Type
::T_STRING
,
232 'title' => ts('Dashlet Permission'),
233 'description' => ts('Permission for the dashlet'),
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',
241 'serialize' => self
::SERIALIZE_COMMA
,
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'),
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',
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'),
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',
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',
279 'table_name' => 'civicrm_dashboard',
280 'entity' => 'Dashboard',
281 'bao' => 'CRM_Core_BAO_Dashboard',
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',
292 'table_name' => 'civicrm_dashboard',
293 'entity' => 'Dashboard',
294 'bao' => 'CRM_Core_BAO_Dashboard',
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.'),
304 'where' => 'civicrm_dashboard.cache_minutes',
306 'table_name' => 'civicrm_dashboard',
307 'entity' => 'Dashboard',
308 'bao' => 'CRM_Core_BAO_Dashboard',
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)'),
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',
327 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
329 return Civi
::$statics[__CLASS__
]['fields'];
333 * Return a mapping from field-name to the corresponding key (as used in fields()).
336 * Array(string $name => string $uniqueName).
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()));
342 return Civi
::$statics[__CLASS__
]['fieldKeys'];
346 * Returns the names of this table
350 public static function getTableName() {
351 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
355 * Returns if this table needs to be logged
359 public function getLog() {
364 * Returns the list of fields that can be imported
366 * @param bool $prefix
370 public static function &import($prefix = FALSE) {
371 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dashboard', $prefix, []);
376 * Returns the list of fields that can be exported
378 * @param bool $prefix
382 public static function &export($prefix = FALSE) {
383 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dashboard', $prefix, []);
388 * Returns the list of indices
390 * @param bool $localize
394 public static function indices($localize = TRUE) {
396 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;