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:cde009752aa290013f7eca7fed93b9bb)
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 localized title of this entity.
117 public static function getEntityTitle() {
118 return ts('Dashboards');
122 * Returns foreign keys and entity references.
125 * [CRM_Core_Reference_Interface]
127 public static function getReferenceColumns() {
128 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
129 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
130 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
131 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
133 return Civi
::$statics[__CLASS__
]['links'];
137 * Returns all the column names of this table
141 public static function &fields() {
142 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
143 Civi
::$statics[__CLASS__
]['fields'] = [
146 'type' => CRM_Utils_Type
::T_INT
,
147 'title' => ts('DashletID'),
149 'where' => 'civicrm_dashboard.id',
150 'table_name' => 'civicrm_dashboard',
151 'entity' => 'Dashboard',
152 'bao' => 'CRM_Core_BAO_Dashboard',
156 'name' => 'domain_id',
157 'type' => CRM_Utils_Type
::T_INT
,
158 'title' => ts('Dashlet Domain'),
159 'description' => ts('Domain for dashboard'),
161 'where' => 'civicrm_dashboard.domain_id',
162 'table_name' => 'civicrm_dashboard',
163 'entity' => 'Dashboard',
164 'bao' => 'CRM_Core_BAO_Dashboard',
166 'FKClassName' => 'CRM_Core_DAO_Domain',
167 'pseudoconstant' => [
168 'table' => 'civicrm_domain',
170 'labelColumn' => 'name',
175 'type' => CRM_Utils_Type
::T_STRING
,
176 'title' => ts('Dashlet Name'),
177 'description' => ts('Internal name of dashlet.'),
179 'size' => CRM_Utils_Type
::BIG
,
180 'where' => 'civicrm_dashboard.name',
181 'table_name' => 'civicrm_dashboard',
182 'entity' => 'Dashboard',
183 'bao' => 'CRM_Core_BAO_Dashboard',
188 'type' => CRM_Utils_Type
::T_STRING
,
189 'title' => ts('Dashlet Title'),
190 'description' => ts('dashlet title'),
192 'size' => CRM_Utils_Type
::HUGE
,
193 'where' => 'civicrm_dashboard.label',
194 'table_name' => 'civicrm_dashboard',
195 'entity' => 'Dashboard',
196 'bao' => 'CRM_Core_BAO_Dashboard',
201 'type' => CRM_Utils_Type
::T_STRING
,
202 'title' => ts('Dashlet URL'),
203 'description' => ts('url in case of external dashlet'),
205 'size' => CRM_Utils_Type
::HUGE
,
206 'where' => 'civicrm_dashboard.url',
207 'table_name' => 'civicrm_dashboard',
208 'entity' => 'Dashboard',
209 'bao' => 'CRM_Core_BAO_Dashboard',
213 'name' => 'permission',
214 'type' => CRM_Utils_Type
::T_STRING
,
215 'title' => ts('Dashlet Permission'),
216 'description' => ts('Permission for the dashlet'),
218 'size' => CRM_Utils_Type
::HUGE
,
219 'where' => 'civicrm_dashboard.permission',
220 'table_name' => 'civicrm_dashboard',
221 'entity' => 'Dashboard',
222 'bao' => 'CRM_Core_BAO_Dashboard',
224 'serialize' => self
::SERIALIZE_COMMA
,
226 'permission_operator' => [
227 'name' => 'permission_operator',
228 'type' => CRM_Utils_Type
::T_STRING
,
229 'title' => ts('Dashlet Permission Operator'),
230 'description' => ts('Permission Operator'),
232 'size' => CRM_Utils_Type
::FOUR
,
233 'where' => 'civicrm_dashboard.permission_operator',
234 'table_name' => 'civicrm_dashboard',
235 'entity' => 'Dashboard',
236 'bao' => 'CRM_Core_BAO_Dashboard',
239 'fullscreen_url' => [
240 'name' => 'fullscreen_url',
241 'type' => CRM_Utils_Type
::T_STRING
,
242 'title' => ts('Fullscreen URL'),
243 'description' => ts('fullscreen url for dashlet'),
245 'size' => CRM_Utils_Type
::HUGE
,
246 'where' => 'civicrm_dashboard.fullscreen_url',
247 'table_name' => 'civicrm_dashboard',
248 'entity' => 'Dashboard',
249 'bao' => 'CRM_Core_BAO_Dashboard',
253 'name' => 'is_active',
254 'type' => CRM_Utils_Type
::T_BOOLEAN
,
255 'title' => ts('Is Dashlet Active?'),
256 'description' => ts('Is this dashlet active?'),
257 'where' => 'civicrm_dashboard.is_active',
259 'table_name' => 'civicrm_dashboard',
260 'entity' => 'Dashboard',
261 'bao' => 'CRM_Core_BAO_Dashboard',
265 'name' => 'is_reserved',
266 'type' => CRM_Utils_Type
::T_BOOLEAN
,
267 'title' => ts('Is Dashlet Reserved?'),
268 'description' => ts('Is this dashlet reserved?'),
269 'where' => 'civicrm_dashboard.is_reserved',
271 'table_name' => 'civicrm_dashboard',
272 'entity' => 'Dashboard',
273 'bao' => 'CRM_Core_BAO_Dashboard',
277 'name' => 'cache_minutes',
278 'type' => CRM_Utils_Type
::T_INT
,
279 'title' => ts('Cache Minutes'),
280 'description' => ts('Number of minutes to cache dashlet content in browser localStorage.'),
282 'where' => 'civicrm_dashboard.cache_minutes',
284 'table_name' => 'civicrm_dashboard',
285 'entity' => 'Dashboard',
286 'bao' => 'CRM_Core_BAO_Dashboard',
290 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
292 return Civi
::$statics[__CLASS__
]['fields'];
296 * Return a mapping from field-name to the corresponding key (as used in fields()).
299 * Array(string $name => string $uniqueName).
301 public static function &fieldKeys() {
302 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
303 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
305 return Civi
::$statics[__CLASS__
]['fieldKeys'];
309 * Returns the names of this table
313 public static function getTableName() {
314 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
318 * Returns if this table needs to be logged
322 public function getLog() {
327 * Returns the list of fields that can be imported
329 * @param bool $prefix
333 public static function &import($prefix = FALSE) {
334 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dashboard', $prefix, []);
339 * Returns the list of fields that can be exported
341 * @param bool $prefix
345 public static function &export($prefix = FALSE) {
346 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dashboard', $prefix, []);
351 * Returns the list of indices
353 * @param bool $localize
357 public static function indices($localize = TRUE) {
359 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;