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/Contact/DashboardContact.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
437fafcf | 33 | * (GenCodeChecksum:5f01747804c5bfc8418f0c6bfa587228) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
37 | class CRM_Contact_DAO_DashboardContact extends CRM_Core_DAO { | |
38 | /** | |
39 | * static instance to hold the table name | |
40 | * | |
41 | * @var string | |
42 | */ | |
43 | static $_tableName = 'civicrm_dashboard_contact'; | |
44 | /** | |
45 | * static instance to hold the field values | |
46 | * | |
47 | * @var array | |
48 | */ | |
49 | static $_fields = null; | |
50 | /** | |
51 | * static instance to hold the keys used in $_fields for each field. | |
52 | * | |
53 | * @var array | |
54 | */ | |
55 | static $_fieldKeys = null; | |
56 | /** | |
57 | * static instance to hold the FK relationships | |
58 | * | |
59 | * @var string | |
60 | */ | |
61 | static $_links = null; | |
62 | /** | |
63 | * static instance to hold the values that can | |
64 | * be imported | |
65 | * | |
66 | * @var array | |
67 | */ | |
68 | static $_import = null; | |
69 | /** | |
70 | * static instance to hold the values that can | |
71 | * be exported | |
72 | * | |
73 | * @var array | |
74 | */ | |
75 | static $_export = null; | |
76 | /** | |
77 | * static value to see if we should log any modifications to | |
78 | * this table in the civicrm_log table | |
79 | * | |
80 | * @var boolean | |
81 | */ | |
82 | static $_log = false; | |
83 | /** | |
84 | * | |
85 | * @var int unsigned | |
86 | */ | |
87 | public $id; | |
88 | /** | |
89 | * Dashboard ID | |
90 | * | |
91 | * @var int unsigned | |
92 | */ | |
93 | public $dashboard_id; | |
94 | /** | |
95 | * Contact ID | |
96 | * | |
97 | * @var int unsigned | |
98 | */ | |
99 | public $contact_id; | |
100 | /** | |
101 | * column no for this widget | |
102 | * | |
103 | * @var boolean | |
104 | */ | |
105 | public $column_no; | |
106 | /** | |
107 | * Is Minimized? | |
108 | * | |
109 | * @var boolean | |
110 | */ | |
111 | public $is_minimized; | |
112 | /** | |
113 | * Is Fullscreen? | |
114 | * | |
115 | * @var boolean | |
116 | */ | |
117 | public $is_fullscreen; | |
118 | /** | |
119 | * Is this widget active? | |
120 | * | |
121 | * @var boolean | |
122 | */ | |
123 | public $is_active; | |
124 | /** | |
125 | * Ordering of the widgets. | |
126 | * | |
127 | * @var int | |
128 | */ | |
129 | public $weight; | |
130 | /** | |
131 | * dashlet content | |
132 | * | |
133 | * @var longtext | |
134 | */ | |
135 | public $content; | |
136 | /** | |
137 | * When was content populated | |
138 | * | |
139 | * @var datetime | |
140 | */ | |
141 | public $created_date; | |
142 | /** | |
143 | * class constructor | |
144 | * | |
145 | * @return civicrm_dashboard_contact | |
146 | */ | |
147 | function __construct() { | |
148 | $this->__table = 'civicrm_dashboard_contact'; | |
149 | parent::__construct(); | |
150 | } | |
151 | /** | |
152 | * Returns foreign keys and entity references | |
153 | * | |
154 | * @return array | |
155 | * [CRM_Core_Reference_Interface] | |
156 | */ | |
157 | static function getReferenceColumns() { | |
158 | if (!self::$_links) { | |
159 | self::$_links = static ::createReferenceColumns(__CLASS__); | |
160 | self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'dashboard_id', 'civicrm_dashboard', 'id'); | |
161 | self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contact_id', 'civicrm_contact', 'id'); | |
162 | } | |
163 | return self::$_links; | |
164 | } | |
165 | /** | |
166 | * Returns all the column names of this table | |
167 | * | |
168 | * @return array | |
169 | */ | |
170 | static function &fields() { | |
171 | if (!(self::$_fields)) { | |
172 | self::$_fields = array( | |
173 | 'id' => array( | |
174 | 'name' => 'id', | |
175 | 'type' => CRM_Utils_Type::T_INT, | |
176 | 'title' => ts('Dashboard Contact ID') , | |
177 | 'required' => true, | |
178 | ) , | |
179 | 'dashboard_id' => array( | |
180 | 'name' => 'dashboard_id', | |
181 | 'type' => CRM_Utils_Type::T_INT, | |
182 | 'title' => ts('Dashboard') , | |
183 | 'description' => 'Dashboard ID', | |
184 | 'required' => true, | |
185 | 'FKClassName' => 'CRM_Core_DAO_Dashboard', | |
186 | ) , | |
187 | 'contact_id' => array( | |
188 | 'name' => 'contact_id', | |
189 | 'type' => CRM_Utils_Type::T_INT, | |
190 | 'title' => ts('Dashboard Contact') , | |
191 | 'description' => 'Contact ID', | |
192 | 'required' => true, | |
193 | 'FKClassName' => 'CRM_Contact_DAO_Contact', | |
194 | ) , | |
195 | 'column_no' => array( | |
196 | 'name' => 'column_no', | |
197 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
198 | 'title' => ts('Column No') , | |
199 | 'description' => 'column no for this widget', | |
200 | ) , | |
201 | 'is_minimized' => array( | |
202 | 'name' => 'is_minimized', | |
203 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
204 | 'title' => ts('Dashlet is Minimized?') , | |
205 | 'description' => 'Is Minimized?', | |
206 | ) , | |
207 | 'is_fullscreen' => array( | |
208 | 'name' => 'is_fullscreen', | |
209 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
210 | 'title' => ts('Dashlet is FullScreen?') , | |
211 | 'description' => 'Is Fullscreen?', | |
212 | 'default' => '1', | |
213 | ) , | |
214 | 'is_active' => array( | |
215 | 'name' => 'is_active', | |
216 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
217 | 'title' => ts('Dashlet is Active?') , | |
218 | 'description' => 'Is this widget active?', | |
219 | ) , | |
220 | 'weight' => array( | |
221 | 'name' => 'weight', | |
222 | 'type' => CRM_Utils_Type::T_INT, | |
223 | 'title' => ts('Order') , | |
224 | 'description' => 'Ordering of the widgets.', | |
225 | ) , | |
226 | 'content' => array( | |
227 | 'name' => 'content', | |
228 | 'type' => CRM_Utils_Type::T_LONGTEXT, | |
229 | 'title' => ts('Content') , | |
230 | 'description' => 'dashlet content', | |
231 | ) , | |
232 | 'created_date' => array( | |
233 | 'name' => 'created_date', | |
234 | 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, | |
235 | 'title' => ts('Dashlet Created On') , | |
236 | 'description' => 'When was content populated', | |
237 | ) , | |
238 | ); | |
239 | } | |
240 | return self::$_fields; | |
241 | } | |
242 | /** | |
243 | * Returns an array containing, for each field, the arary key used for that | |
244 | * field in self::$_fields. | |
245 | * | |
246 | * @return array | |
247 | */ | |
248 | static function &fieldKeys() { | |
249 | if (!(self::$_fieldKeys)) { | |
250 | self::$_fieldKeys = array( | |
251 | 'id' => 'id', | |
252 | 'dashboard_id' => 'dashboard_id', | |
253 | 'contact_id' => 'contact_id', | |
254 | 'column_no' => 'column_no', | |
255 | 'is_minimized' => 'is_minimized', | |
256 | 'is_fullscreen' => 'is_fullscreen', | |
257 | 'is_active' => 'is_active', | |
258 | 'weight' => 'weight', | |
259 | 'content' => 'content', | |
260 | 'created_date' => 'created_date', | |
261 | ); | |
262 | } | |
263 | return self::$_fieldKeys; | |
264 | } | |
265 | /** | |
266 | * Returns the names of this table | |
267 | * | |
268 | * @return string | |
269 | */ | |
270 | static function getTableName() { | |
271 | return self::$_tableName; | |
272 | } | |
273 | /** | |
274 | * Returns if this table needs to be logged | |
275 | * | |
276 | * @return boolean | |
277 | */ | |
278 | function getLog() { | |
279 | return self::$_log; | |
280 | } | |
281 | /** | |
282 | * Returns the list of fields that can be imported | |
283 | * | |
284 | * @param bool $prefix | |
285 | * | |
286 | * @return array | |
287 | */ | |
288 | static function &import($prefix = false) { | |
289 | if (!(self::$_import)) { | |
290 | self::$_import = array(); | |
291 | $fields = self::fields(); | |
292 | foreach($fields as $name => $field) { | |
293 | if (CRM_Utils_Array::value('import', $field)) { | |
294 | if ($prefix) { | |
295 | self::$_import['dashboard_contact'] = & $fields[$name]; | |
296 | } else { | |
297 | self::$_import[$name] = & $fields[$name]; | |
298 | } | |
299 | } | |
300 | } | |
301 | } | |
302 | return self::$_import; | |
303 | } | |
304 | /** | |
305 | * Returns the list of fields that can be exported | |
306 | * | |
307 | * @param bool $prefix | |
308 | * | |
309 | * @return array | |
310 | */ | |
311 | static function &export($prefix = false) { | |
312 | if (!(self::$_export)) { | |
313 | self::$_export = array(); | |
314 | $fields = self::fields(); | |
315 | foreach($fields as $name => $field) { | |
316 | if (CRM_Utils_Array::value('export', $field)) { | |
317 | if ($prefix) { | |
318 | self::$_export['dashboard_contact'] = & $fields[$name]; | |
319 | } else { | |
320 | self::$_export[$name] = & $fields[$name]; | |
321 | } | |
322 | } | |
323 | } | |
324 | } | |
325 | return self::$_export; | |
326 | } | |
327 | } |