Commit | Line | Data |
---|---|---|
e501603b TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
4 | | CiviCRM version 4.7 | | |
5 | +--------------------------------------------------------------------+ | |
6 | | Copyright CiviCRM LLC (c) 2004-2016 | | |
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 | |
29 | * @copyright CiviCRM LLC (c) 2004-2016 | |
30 | * | |
31 | * Generated from xml/schema/CRM/Core/Dashboard.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
437fafcf | 33 | * (GenCodeChecksum:b5c91969a65943ff6daf8c43a9bd0fe4) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
37 | class CRM_Core_DAO_Dashboard extends CRM_Core_DAO { | |
38 | /** | |
39 | * static instance to hold the table name | |
40 | * | |
41 | * @var string | |
42 | */ | |
43 | static $_tableName = 'civicrm_dashboard'; | |
e501603b TO |
44 | /** |
45 | * static value to see if we should log any modifications to | |
46 | * this table in the civicrm_log table | |
47 | * | |
48 | * @var boolean | |
49 | */ | |
50 | static $_log = false; | |
51 | /** | |
52 | * | |
53 | * @var int unsigned | |
54 | */ | |
55 | public $id; | |
56 | /** | |
57 | * Domain for dashboard | |
58 | * | |
59 | * @var int unsigned | |
60 | */ | |
61 | public $domain_id; | |
62 | /** | |
63 | * Internal name of dashlet. | |
64 | * | |
65 | * @var string | |
66 | */ | |
67 | public $name; | |
68 | /** | |
69 | * dashlet title | |
70 | * | |
71 | * @var string | |
72 | */ | |
73 | public $label; | |
74 | /** | |
75 | * url in case of external dashlet | |
76 | * | |
77 | * @var string | |
78 | */ | |
79 | public $url; | |
80 | /** | |
81 | * Permission for the dashlet | |
82 | * | |
83 | * @var string | |
84 | */ | |
85 | public $permission; | |
86 | /** | |
87 | * Permission Operator | |
88 | * | |
89 | * @var string | |
90 | */ | |
91 | public $permission_operator; | |
92 | /** | |
93 | * column no for this dashlet | |
94 | * | |
95 | * @var boolean | |
96 | */ | |
97 | public $column_no; | |
98 | /** | |
99 | * Is Minimized? | |
100 | * | |
101 | * @var boolean | |
102 | */ | |
103 | public $is_minimized; | |
104 | /** | |
105 | * fullscreen url for dashlet | |
106 | * | |
107 | * @var string | |
108 | */ | |
109 | public $fullscreen_url; | |
110 | /** | |
111 | * Is Fullscreen? | |
112 | * | |
113 | * @var boolean | |
114 | */ | |
115 | public $is_fullscreen; | |
116 | /** | |
117 | * Is this dashlet active? | |
118 | * | |
119 | * @var boolean | |
120 | */ | |
121 | public $is_active; | |
122 | /** | |
123 | * Is this dashlet reserved? | |
124 | * | |
125 | * @var boolean | |
126 | */ | |
127 | public $is_reserved; | |
128 | /** | |
129 | * Ordering of the dashlets. | |
130 | * | |
131 | * @var int | |
132 | */ | |
133 | public $weight; | |
134 | /** | |
135 | * class constructor | |
136 | * | |
137 | * @return civicrm_dashboard | |
138 | */ | |
139 | function __construct() { | |
140 | $this->__table = 'civicrm_dashboard'; | |
141 | parent::__construct(); | |
142 | } | |
143 | /** | |
144 | * Returns foreign keys and entity references | |
145 | * | |
146 | * @return array | |
147 | * [CRM_Core_Reference_Interface] | |
148 | */ | |
149 | static function getReferenceColumns() { | |
346aaaba TO |
150 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
151 | Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__); | |
152 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id'); | |
153 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); | |
e501603b | 154 | } |
346aaaba | 155 | return Civi::$statics[__CLASS__]['links']; |
e501603b TO |
156 | } |
157 | /** | |
158 | * Returns all the column names of this table | |
159 | * | |
160 | * @return array | |
161 | */ | |
162 | static function &fields() { | |
346aaaba TO |
163 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
164 | Civi::$statics[__CLASS__]['fields'] = array( | |
e501603b TO |
165 | 'id' => array( |
166 | 'name' => 'id', | |
167 | 'type' => CRM_Utils_Type::T_INT, | |
168 | 'title' => ts('DashletID') , | |
169 | 'required' => true, | |
170 | ) , | |
171 | 'domain_id' => array( | |
172 | 'name' => 'domain_id', | |
173 | 'type' => CRM_Utils_Type::T_INT, | |
174 | 'title' => ts('Dashlet Domain') , | |
175 | 'description' => 'Domain for dashboard', | |
176 | 'required' => true, | |
177 | 'FKClassName' => 'CRM_Core_DAO_Domain', | |
178 | 'pseudoconstant' => array( | |
179 | 'table' => 'civicrm_domain', | |
180 | 'keyColumn' => 'id', | |
181 | 'labelColumn' => 'name', | |
182 | ) | |
183 | ) , | |
184 | 'name' => array( | |
185 | 'name' => 'name', | |
186 | 'type' => CRM_Utils_Type::T_STRING, | |
187 | 'title' => ts('Dashlet Name') , | |
188 | 'description' => 'Internal name of dashlet.', | |
189 | 'maxlength' => 64, | |
190 | 'size' => CRM_Utils_Type::BIG, | |
191 | ) , | |
192 | 'label' => array( | |
193 | 'name' => 'label', | |
194 | 'type' => CRM_Utils_Type::T_STRING, | |
195 | 'title' => ts('Dashlet Title') , | |
196 | 'description' => 'dashlet title', | |
197 | 'maxlength' => 255, | |
198 | 'size' => CRM_Utils_Type::HUGE, | |
199 | ) , | |
200 | 'url' => array( | |
201 | 'name' => 'url', | |
202 | 'type' => CRM_Utils_Type::T_STRING, | |
203 | 'title' => ts('Dashlet URL') , | |
204 | 'description' => 'url in case of external dashlet', | |
205 | 'maxlength' => 255, | |
206 | 'size' => CRM_Utils_Type::HUGE, | |
207 | ) , | |
208 | 'permission' => array( | |
209 | 'name' => 'permission', | |
210 | 'type' => CRM_Utils_Type::T_STRING, | |
211 | 'title' => ts('Dashlet Permission') , | |
212 | 'description' => 'Permission for the dashlet', | |
213 | 'maxlength' => 255, | |
214 | 'size' => CRM_Utils_Type::HUGE, | |
215 | ) , | |
216 | 'permission_operator' => array( | |
217 | 'name' => 'permission_operator', | |
218 | 'type' => CRM_Utils_Type::T_STRING, | |
219 | 'title' => ts('Dashlet Permission Operator') , | |
220 | 'description' => 'Permission Operator', | |
221 | 'maxlength' => 3, | |
222 | 'size' => CRM_Utils_Type::FOUR, | |
223 | ) , | |
224 | 'column_no' => array( | |
225 | 'name' => 'column_no', | |
226 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
227 | 'title' => ts('Dashlet Column') , | |
228 | 'description' => 'column no for this dashlet', | |
229 | ) , | |
230 | 'is_minimized' => array( | |
231 | 'name' => 'is_minimized', | |
232 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
233 | 'title' => ts('Minimize Dashlet?') , | |
234 | 'description' => 'Is Minimized?', | |
235 | ) , | |
236 | 'fullscreen_url' => array( | |
237 | 'name' => 'fullscreen_url', | |
238 | 'type' => CRM_Utils_Type::T_STRING, | |
239 | 'title' => ts('Fullscreen URL') , | |
240 | 'description' => 'fullscreen url for dashlet', | |
241 | 'maxlength' => 255, | |
242 | 'size' => CRM_Utils_Type::HUGE, | |
243 | ) , | |
244 | 'is_fullscreen' => array( | |
245 | 'name' => 'is_fullscreen', | |
246 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
247 | 'title' => ts('Is Fullscreen?') , | |
248 | 'description' => 'Is Fullscreen?', | |
249 | 'default' => '1', | |
250 | ) , | |
251 | 'is_active' => array( | |
252 | 'name' => 'is_active', | |
253 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
254 | 'title' => ts('Is Dashlet Active?') , | |
255 | 'description' => 'Is this dashlet active?', | |
256 | ) , | |
257 | 'is_reserved' => array( | |
258 | 'name' => 'is_reserved', | |
259 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
260 | 'title' => ts('Is Dashlet Reserved?') , | |
261 | 'description' => 'Is this dashlet reserved?', | |
262 | ) , | |
263 | 'weight' => array( | |
264 | 'name' => 'weight', | |
265 | 'type' => CRM_Utils_Type::T_INT, | |
266 | 'title' => ts('Order') , | |
267 | 'description' => 'Ordering of the dashlets.', | |
268 | ) , | |
269 | ); | |
346aaaba | 270 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 271 | } |
346aaaba | 272 | return Civi::$statics[__CLASS__]['fields']; |
e501603b TO |
273 | } |
274 | /** | |
bd8e0b14 | 275 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
276 | * |
277 | * @return array | |
bd8e0b14 | 278 | * Array(string $name => string $uniqueName). |
e501603b TO |
279 | */ |
280 | static function &fieldKeys() { | |
bd8e0b14 TO |
281 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
282 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 283 | } |
bd8e0b14 | 284 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b TO |
285 | } |
286 | /** | |
287 | * Returns the names of this table | |
288 | * | |
289 | * @return string | |
290 | */ | |
291 | static function getTableName() { | |
292 | return CRM_Core_DAO::getLocaleTableName(self::$_tableName); | |
293 | } | |
294 | /** | |
295 | * Returns if this table needs to be logged | |
296 | * | |
297 | * @return boolean | |
298 | */ | |
299 | function getLog() { | |
300 | return self::$_log; | |
301 | } | |
302 | /** | |
303 | * Returns the list of fields that can be imported | |
304 | * | |
305 | * @param bool $prefix | |
306 | * | |
307 | * @return array | |
308 | */ | |
309 | static function &import($prefix = false) { | |
60808919 TO |
310 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'dashboard', $prefix, array()); |
311 | return $r; | |
e501603b TO |
312 | } |
313 | /** | |
314 | * Returns the list of fields that can be exported | |
315 | * | |
316 | * @param bool $prefix | |
317 | * | |
318 | * @return array | |
319 | */ | |
320 | static function &export($prefix = false) { | |
60808919 TO |
321 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'dashboard', $prefix, array()); |
322 | return $r; | |
e501603b TO |
323 | } |
324 | } |