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:6fd1bfbecace855a159025ad31e37fb0)
13 * Database access object for the Dashboard entity.
15 class CRM_Core_DAO_Dashboard
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_dashboard';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
37 * Domain for dashboard
44 * Internal name of dashlet.
58 * url in case of external dashlet
65 * Permission for the dashlet
76 public $permission_operator;
79 * fullscreen url for dashlet
83 public $fullscreen_url;
86 * Is this dashlet active?
93 * Is this dashlet reserved?
100 * Number of minutes to cache dashlet content in browser localStorage.
104 public $cache_minutes;
109 public function __construct() {
110 $this->__table
= 'civicrm_dashboard';
111 parent
::__construct();
115 * Returns foreign keys and entity references.
118 * [CRM_Core_Reference_Interface]
120 public static function getReferenceColumns() {
121 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
122 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
123 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
124 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
126 return Civi
::$statics[__CLASS__
]['links'];
130 * Returns all the column names of this table
134 public static function &fields() {
135 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
136 Civi
::$statics[__CLASS__
]['fields'] = [
139 'type' => CRM_Utils_Type
::T_INT
,
140 'title' => ts('DashletID'),
142 'where' => 'civicrm_dashboard.id',
143 'table_name' => 'civicrm_dashboard',
144 'entity' => 'Dashboard',
145 'bao' => 'CRM_Core_BAO_Dashboard',
149 'name' => 'domain_id',
150 'type' => CRM_Utils_Type
::T_INT
,
151 'title' => ts('Dashlet Domain'),
152 'description' => ts('Domain for dashboard'),
154 'where' => 'civicrm_dashboard.domain_id',
155 'table_name' => 'civicrm_dashboard',
156 'entity' => 'Dashboard',
157 'bao' => 'CRM_Core_BAO_Dashboard',
159 'FKClassName' => 'CRM_Core_DAO_Domain',
160 'pseudoconstant' => [
161 'table' => 'civicrm_domain',
163 'labelColumn' => 'name',
168 'type' => CRM_Utils_Type
::T_STRING
,
169 'title' => ts('Dashlet Name'),
170 'description' => ts('Internal name of dashlet.'),
172 'size' => CRM_Utils_Type
::BIG
,
173 'where' => 'civicrm_dashboard.name',
174 'table_name' => 'civicrm_dashboard',
175 'entity' => 'Dashboard',
176 'bao' => 'CRM_Core_BAO_Dashboard',
181 'type' => CRM_Utils_Type
::T_STRING
,
182 'title' => ts('Dashlet Title'),
183 'description' => ts('dashlet title'),
185 'size' => CRM_Utils_Type
::HUGE
,
186 'where' => 'civicrm_dashboard.label',
187 'table_name' => 'civicrm_dashboard',
188 'entity' => 'Dashboard',
189 'bao' => 'CRM_Core_BAO_Dashboard',
194 'type' => CRM_Utils_Type
::T_STRING
,
195 'title' => ts('Dashlet URL'),
196 'description' => ts('url in case of external dashlet'),
198 'size' => CRM_Utils_Type
::HUGE
,
199 'where' => 'civicrm_dashboard.url',
200 'table_name' => 'civicrm_dashboard',
201 'entity' => 'Dashboard',
202 'bao' => 'CRM_Core_BAO_Dashboard',
206 'name' => 'permission',
207 'type' => CRM_Utils_Type
::T_STRING
,
208 'title' => ts('Dashlet Permission'),
209 'description' => ts('Permission for the dashlet'),
211 'size' => CRM_Utils_Type
::HUGE
,
212 'where' => 'civicrm_dashboard.permission',
213 'table_name' => 'civicrm_dashboard',
214 'entity' => 'Dashboard',
215 'bao' => 'CRM_Core_BAO_Dashboard',
218 'permission_operator' => [
219 'name' => 'permission_operator',
220 'type' => CRM_Utils_Type
::T_STRING
,
221 'title' => ts('Dashlet Permission Operator'),
222 'description' => ts('Permission Operator'),
224 'size' => CRM_Utils_Type
::FOUR
,
225 'where' => 'civicrm_dashboard.permission_operator',
226 'table_name' => 'civicrm_dashboard',
227 'entity' => 'Dashboard',
228 'bao' => 'CRM_Core_BAO_Dashboard',
231 'fullscreen_url' => [
232 'name' => 'fullscreen_url',
233 'type' => CRM_Utils_Type
::T_STRING
,
234 'title' => ts('Fullscreen URL'),
235 'description' => ts('fullscreen url for dashlet'),
237 'size' => CRM_Utils_Type
::HUGE
,
238 'where' => 'civicrm_dashboard.fullscreen_url',
239 'table_name' => 'civicrm_dashboard',
240 'entity' => 'Dashboard',
241 'bao' => 'CRM_Core_BAO_Dashboard',
245 'name' => 'is_active',
246 'type' => CRM_Utils_Type
::T_BOOLEAN
,
247 'title' => ts('Is Dashlet Active?'),
248 'description' => ts('Is this dashlet active?'),
249 'where' => 'civicrm_dashboard.is_active',
251 'table_name' => 'civicrm_dashboard',
252 'entity' => 'Dashboard',
253 'bao' => 'CRM_Core_BAO_Dashboard',
257 'name' => 'is_reserved',
258 'type' => CRM_Utils_Type
::T_BOOLEAN
,
259 'title' => ts('Is Dashlet Reserved?'),
260 'description' => ts('Is this dashlet reserved?'),
261 'where' => 'civicrm_dashboard.is_reserved',
263 'table_name' => 'civicrm_dashboard',
264 'entity' => 'Dashboard',
265 'bao' => 'CRM_Core_BAO_Dashboard',
269 'name' => 'cache_minutes',
270 'type' => CRM_Utils_Type
::T_INT
,
271 'title' => ts('Cache Minutes'),
272 'description' => ts('Number of minutes to cache dashlet content in browser localStorage.'),
274 'where' => 'civicrm_dashboard.cache_minutes',
276 'table_name' => 'civicrm_dashboard',
277 'entity' => 'Dashboard',
278 'bao' => 'CRM_Core_BAO_Dashboard',
282 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
284 return Civi
::$statics[__CLASS__
]['fields'];
288 * Return a mapping from field-name to the corresponding key (as used in fields()).
291 * Array(string $name => string $uniqueName).
293 public static function &fieldKeys() {
294 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
295 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
297 return Civi
::$statics[__CLASS__
]['fieldKeys'];
301 * Returns the names of this table
305 public static function getTableName() {
306 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
310 * Returns if this table needs to be logged
314 public function getLog() {
319 * Returns the list of fields that can be imported
321 * @param bool $prefix
325 public static function &import($prefix = FALSE) {
326 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dashboard', $prefix, []);
331 * Returns the list of fields that can be exported
333 * @param bool $prefix
337 public static function &export($prefix = FALSE) {
338 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dashboard', $prefix, []);
343 * Returns the list of indices
345 * @param bool $localize
349 public static function indices($localize = TRUE) {
351 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;