CRM-20312 regenerated DAO with localisation
[civicrm-core.git] / CRM / Core / DAO / Dashboard.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
0f03f337 6| Copyright CiviCRM LLC (c) 2004-2017 |
e501603b
TO
7+--------------------------------------------------------------------+
8| This file is a part of CiviCRM. |
9| |
10| CiviCRM is free software; you can copy, modify, and distribute it |
11| under the terms of the GNU Affero General Public License |
12| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13| |
14| CiviCRM is distributed in the hope that it will be useful, but |
15| WITHOUT ANY WARRANTY; without even the implied warranty of |
16| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17| See the GNU Affero General Public License for more details. |
18| |
19| You should have received a copy of the GNU Affero General Public |
20| License and the CiviCRM Licensing Exception along |
21| with this program; if not, contact CiviCRM LLC |
22| at info[AT]civicrm[DOT]org. If you have questions about the |
23| GNU Affero General Public License or the licensing of CiviCRM, |
24| see the CiviCRM license FAQ at http://civicrm.org/licensing |
25+--------------------------------------------------------------------+
26*/
27/**
28 * @package CRM
0f03f337 29 * @copyright CiviCRM LLC (c) 2004-2017
e501603b
TO
30 *
31 * Generated from xml/schema/CRM/Core/Dashboard.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
6a7e5e5d 33 * (GenCodeChecksum:6b7454609bac684a5d32597cdd433f3d)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
f41f0342 37/**
38 * CRM_Core_DAO_Dashboard constructor.
39 */
e501603b
TO
40class CRM_Core_DAO_Dashboard extends CRM_Core_DAO {
41 /**
f41f0342 42 * Static instance to hold the table name.
e501603b
TO
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_dashboard';
e501603b 47 /**
f41f0342 48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b
TO
49 *
50 * @var boolean
51 */
52 static $_log = false;
53 /**
54 *
55 * @var int unsigned
56 */
57 public $id;
58 /**
59 * Domain for dashboard
60 *
61 * @var int unsigned
62 */
63 public $domain_id;
64 /**
65 * Internal name of dashlet.
66 *
67 * @var string
68 */
69 public $name;
70 /**
71 * dashlet title
72 *
73 * @var string
74 */
75 public $label;
76 /**
77 * url in case of external dashlet
78 *
79 * @var string
80 */
81 public $url;
82 /**
83 * Permission for the dashlet
84 *
85 * @var string
86 */
87 public $permission;
88 /**
89 * Permission Operator
90 *
91 * @var string
92 */
93 public $permission_operator;
e501603b
TO
94 /**
95 * fullscreen url for dashlet
96 *
97 * @var string
98 */
99 public $fullscreen_url;
e501603b
TO
100 /**
101 * Is this dashlet active?
102 *
103 * @var boolean
104 */
105 public $is_active;
106 /**
107 * Is this dashlet reserved?
108 *
109 * @var boolean
110 */
111 public $is_reserved;
112 /**
bf7df0ec 113 * Number of minutes to cache dashlet content in browser localStorage.
e501603b 114 *
bf7df0ec 115 * @var int unsigned
e501603b 116 */
bf7df0ec 117 public $cache_minutes;
e501603b 118 /**
f41f0342 119 * Class constructor.
e501603b
TO
120 */
121 function __construct() {
122 $this->__table = 'civicrm_dashboard';
123 parent::__construct();
124 }
125 /**
f41f0342 126 * Returns foreign keys and entity references.
e501603b
TO
127 *
128 * @return array
129 * [CRM_Core_Reference_Interface]
130 */
131 static function getReferenceColumns() {
346aaaba
TO
132 if (!isset(Civi::$statics[__CLASS__]['links'])) {
133 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
134 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id');
135 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 136 }
346aaaba 137 return Civi::$statics[__CLASS__]['links'];
e501603b
TO
138 }
139 /**
140 * Returns all the column names of this table
141 *
142 * @return array
143 */
144 static function &fields() {
346aaaba
TO
145 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
146 Civi::$statics[__CLASS__]['fields'] = array(
e501603b
TO
147 'id' => array(
148 'name' => 'id',
149 'type' => CRM_Utils_Type::T_INT,
150 'title' => ts('DashletID') ,
151 'required' => true,
522a26c9 152 'table_name' => 'civicrm_dashboard',
153 'entity' => 'Dashboard',
154 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 155 'localizable' => 0,
e501603b
TO
156 ) ,
157 'domain_id' => array(
158 'name' => 'domain_id',
159 'type' => CRM_Utils_Type::T_INT,
160 'title' => ts('Dashlet Domain') ,
161 'description' => 'Domain for dashboard',
162 'required' => true,
522a26c9 163 'table_name' => 'civicrm_dashboard',
164 'entity' => 'Dashboard',
165 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 166 'localizable' => 0,
e501603b
TO
167 'FKClassName' => 'CRM_Core_DAO_Domain',
168 'pseudoconstant' => array(
169 'table' => 'civicrm_domain',
170 'keyColumn' => 'id',
171 'labelColumn' => 'name',
172 )
173 ) ,
174 'name' => array(
175 'name' => 'name',
176 'type' => CRM_Utils_Type::T_STRING,
177 'title' => ts('Dashlet Name') ,
178 'description' => 'Internal name of dashlet.',
179 'maxlength' => 64,
180 'size' => CRM_Utils_Type::BIG,
522a26c9 181 'table_name' => 'civicrm_dashboard',
182 'entity' => 'Dashboard',
183 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 184 'localizable' => 0,
e501603b
TO
185 ) ,
186 'label' => array(
187 'name' => 'label',
188 'type' => CRM_Utils_Type::T_STRING,
189 'title' => ts('Dashlet Title') ,
190 'description' => 'dashlet title',
191 'maxlength' => 255,
192 'size' => CRM_Utils_Type::HUGE,
522a26c9 193 'table_name' => 'civicrm_dashboard',
194 'entity' => 'Dashboard',
195 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 196 'localizable' => 1,
e501603b
TO
197 ) ,
198 'url' => array(
199 'name' => 'url',
200 'type' => CRM_Utils_Type::T_STRING,
201 'title' => ts('Dashlet URL') ,
202 'description' => 'url in case of external dashlet',
203 'maxlength' => 255,
204 'size' => CRM_Utils_Type::HUGE,
522a26c9 205 'table_name' => 'civicrm_dashboard',
206 'entity' => 'Dashboard',
207 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 208 'localizable' => 0,
e501603b
TO
209 ) ,
210 'permission' => array(
211 'name' => 'permission',
212 'type' => CRM_Utils_Type::T_STRING,
213 'title' => ts('Dashlet Permission') ,
214 'description' => 'Permission for the dashlet',
215 'maxlength' => 255,
216 'size' => CRM_Utils_Type::HUGE,
522a26c9 217 'table_name' => 'civicrm_dashboard',
218 'entity' => 'Dashboard',
219 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 220 'localizable' => 0,
e501603b
TO
221 ) ,
222 'permission_operator' => array(
223 'name' => 'permission_operator',
224 'type' => CRM_Utils_Type::T_STRING,
225 'title' => ts('Dashlet Permission Operator') ,
226 'description' => 'Permission Operator',
227 'maxlength' => 3,
228 'size' => CRM_Utils_Type::FOUR,
522a26c9 229 'table_name' => 'civicrm_dashboard',
230 'entity' => 'Dashboard',
231 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 232 'localizable' => 0,
e501603b 233 ) ,
e501603b
TO
234 'fullscreen_url' => array(
235 'name' => 'fullscreen_url',
236 'type' => CRM_Utils_Type::T_STRING,
237 'title' => ts('Fullscreen URL') ,
238 'description' => 'fullscreen url for dashlet',
239 'maxlength' => 255,
240 'size' => CRM_Utils_Type::HUGE,
522a26c9 241 'table_name' => 'civicrm_dashboard',
242 'entity' => 'Dashboard',
243 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 244 'localizable' => 0,
e501603b 245 ) ,
e501603b
TO
246 'is_active' => array(
247 'name' => 'is_active',
248 'type' => CRM_Utils_Type::T_BOOLEAN,
249 'title' => ts('Is Dashlet Active?') ,
250 'description' => 'Is this dashlet active?',
522a26c9 251 'table_name' => 'civicrm_dashboard',
252 'entity' => 'Dashboard',
253 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 254 'localizable' => 0,
e501603b
TO
255 ) ,
256 'is_reserved' => array(
257 'name' => 'is_reserved',
258 'type' => CRM_Utils_Type::T_BOOLEAN,
259 'title' => ts('Is Dashlet Reserved?') ,
260 'description' => 'Is this dashlet reserved?',
522a26c9 261 'table_name' => 'civicrm_dashboard',
262 'entity' => 'Dashboard',
263 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 264 'localizable' => 0,
e501603b 265 ) ,
bf7df0ec
CW
266 'cache_minutes' => array(
267 'name' => 'cache_minutes',
e501603b 268 'type' => CRM_Utils_Type::T_INT,
bf7df0ec
CW
269 'title' => ts('Cache Minutes') ,
270 'description' => 'Number of minutes to cache dashlet content in browser localStorage.',
271 'required' => true,
272 'default' => '60',
522a26c9 273 'table_name' => 'civicrm_dashboard',
274 'entity' => 'Dashboard',
275 'bao' => 'CRM_Core_BAO_Dashboard',
6a7e5e5d 276 'localizable' => 0,
e501603b
TO
277 ) ,
278 );
346aaaba 279 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 280 }
346aaaba 281 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
282 }
283 /**
bd8e0b14 284 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
285 *
286 * @return array
bd8e0b14 287 * Array(string $name => string $uniqueName).
e501603b
TO
288 */
289 static function &fieldKeys() {
bd8e0b14
TO
290 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
291 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 292 }
bd8e0b14 293 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
294 }
295 /**
296 * Returns the names of this table
297 *
298 * @return string
299 */
300 static function getTableName() {
301 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
302 }
303 /**
304 * Returns if this table needs to be logged
305 *
306 * @return boolean
307 */
308 function getLog() {
309 return self::$_log;
310 }
311 /**
312 * Returns the list of fields that can be imported
313 *
314 * @param bool $prefix
315 *
316 * @return array
317 */
318 static function &import($prefix = false) {
60808919
TO
319 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'dashboard', $prefix, array());
320 return $r;
e501603b
TO
321 }
322 /**
323 * Returns the list of fields that can be exported
324 *
325 * @param bool $prefix
326 *
327 * @return array
328 */
329 static function &export($prefix = false) {
60808919
TO
330 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'dashboard', $prefix, array());
331 return $r;
e501603b
TO
332 }
333}