CRM-19925 Add Entity data and date format data to fields array on DAO.
[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
bf7df0ec 33 * (GenCodeChecksum:4d82a52ab0d5d66d835192785ff0c1cc)
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,
152 ) ,
153 'domain_id' => array(
154 'name' => 'domain_id',
155 'type' => CRM_Utils_Type::T_INT,
156 'title' => ts('Dashlet Domain') ,
157 'description' => 'Domain for dashboard',
158 'required' => true,
159 'FKClassName' => 'CRM_Core_DAO_Domain',
160 'pseudoconstant' => array(
161 'table' => 'civicrm_domain',
162 'keyColumn' => 'id',
163 'labelColumn' => 'name',
164 )
165 ) ,
166 'name' => array(
167 'name' => 'name',
168 'type' => CRM_Utils_Type::T_STRING,
169 'title' => ts('Dashlet Name') ,
170 'description' => 'Internal name of dashlet.',
171 'maxlength' => 64,
172 'size' => CRM_Utils_Type::BIG,
173 ) ,
174 'label' => array(
175 'name' => 'label',
176 'type' => CRM_Utils_Type::T_STRING,
177 'title' => ts('Dashlet Title') ,
178 'description' => 'dashlet title',
179 'maxlength' => 255,
180 'size' => CRM_Utils_Type::HUGE,
181 ) ,
182 'url' => array(
183 'name' => 'url',
184 'type' => CRM_Utils_Type::T_STRING,
185 'title' => ts('Dashlet URL') ,
186 'description' => 'url in case of external dashlet',
187 'maxlength' => 255,
188 'size' => CRM_Utils_Type::HUGE,
189 ) ,
190 'permission' => array(
191 'name' => 'permission',
192 'type' => CRM_Utils_Type::T_STRING,
193 'title' => ts('Dashlet Permission') ,
194 'description' => 'Permission for the dashlet',
195 'maxlength' => 255,
196 'size' => CRM_Utils_Type::HUGE,
197 ) ,
198 'permission_operator' => array(
199 'name' => 'permission_operator',
200 'type' => CRM_Utils_Type::T_STRING,
201 'title' => ts('Dashlet Permission Operator') ,
202 'description' => 'Permission Operator',
203 'maxlength' => 3,
204 'size' => CRM_Utils_Type::FOUR,
205 ) ,
e501603b
TO
206 'fullscreen_url' => array(
207 'name' => 'fullscreen_url',
208 'type' => CRM_Utils_Type::T_STRING,
209 'title' => ts('Fullscreen URL') ,
210 'description' => 'fullscreen url for dashlet',
211 'maxlength' => 255,
212 'size' => CRM_Utils_Type::HUGE,
213 ) ,
e501603b
TO
214 'is_active' => array(
215 'name' => 'is_active',
216 'type' => CRM_Utils_Type::T_BOOLEAN,
217 'title' => ts('Is Dashlet Active?') ,
218 'description' => 'Is this dashlet active?',
219 ) ,
220 'is_reserved' => array(
221 'name' => 'is_reserved',
222 'type' => CRM_Utils_Type::T_BOOLEAN,
223 'title' => ts('Is Dashlet Reserved?') ,
224 'description' => 'Is this dashlet reserved?',
225 ) ,
bf7df0ec
CW
226 'cache_minutes' => array(
227 'name' => 'cache_minutes',
e501603b 228 'type' => CRM_Utils_Type::T_INT,
bf7df0ec
CW
229 'title' => ts('Cache Minutes') ,
230 'description' => 'Number of minutes to cache dashlet content in browser localStorage.',
231 'required' => true,
232 'default' => '60',
e501603b
TO
233 ) ,
234 );
346aaaba 235 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 236 }
346aaaba 237 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
238 }
239 /**
bd8e0b14 240 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
241 *
242 * @return array
bd8e0b14 243 * Array(string $name => string $uniqueName).
e501603b
TO
244 */
245 static function &fieldKeys() {
bd8e0b14
TO
246 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
247 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 248 }
bd8e0b14 249 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
250 }
251 /**
252 * Returns the names of this table
253 *
254 * @return string
255 */
256 static function getTableName() {
257 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
258 }
259 /**
260 * Returns if this table needs to be logged
261 *
262 * @return boolean
263 */
264 function getLog() {
265 return self::$_log;
266 }
267 /**
268 * Returns the list of fields that can be imported
269 *
270 * @param bool $prefix
271 *
272 * @return array
273 */
274 static function &import($prefix = false) {
60808919
TO
275 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'dashboard', $prefix, array());
276 return $r;
e501603b
TO
277 }
278 /**
279 * Returns the list of fields that can be exported
280 *
281 * @param bool $prefix
282 *
283 * @return array
284 */
285 static function &export($prefix = false) {
60808919
TO
286 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'dashboard', $prefix, array());
287 return $r;
e501603b
TO
288 }
289}