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/Contribute/Widget.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
437fafcf | 33 | * (GenCodeChecksum:0c274425d81e53c5a1f1a4f4e3078ce3) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
37 | class CRM_Contribute_DAO_Widget extends CRM_Core_DAO { | |
38 | /** | |
39 | * static instance to hold the table name | |
40 | * | |
41 | * @var string | |
42 | */ | |
43 | static $_tableName = 'civicrm_contribution_widget'; | |
44 | /** | |
45 | * static instance to hold the field values | |
46 | * | |
47 | * @var array | |
48 | */ | |
49 | static $_fields = null; | |
e501603b TO |
50 | /** |
51 | * static instance to hold the FK relationships | |
52 | * | |
53 | * @var string | |
54 | */ | |
55 | static $_links = null; | |
e501603b TO |
56 | /** |
57 | * static value to see if we should log any modifications to | |
58 | * this table in the civicrm_log table | |
59 | * | |
60 | * @var boolean | |
61 | */ | |
62 | static $_log = true; | |
63 | /** | |
64 | * Contribution Id | |
65 | * | |
66 | * @var int unsigned | |
67 | */ | |
68 | public $id; | |
69 | /** | |
70 | * The Contribution Page which triggered this contribution | |
71 | * | |
72 | * @var int unsigned | |
73 | */ | |
74 | public $contribution_page_id; | |
75 | /** | |
76 | * Is this property active? | |
77 | * | |
78 | * @var boolean | |
79 | */ | |
80 | public $is_active; | |
81 | /** | |
82 | * Widget title. | |
83 | * | |
84 | * @var string | |
85 | */ | |
86 | public $title; | |
87 | /** | |
88 | * URL to Widget logo | |
89 | * | |
90 | * @var string | |
91 | */ | |
92 | public $url_logo; | |
93 | /** | |
94 | * Button title. | |
95 | * | |
96 | * @var string | |
97 | */ | |
98 | public $button_title; | |
99 | /** | |
100 | * About description. | |
101 | * | |
102 | * @var text | |
103 | */ | |
104 | public $about; | |
105 | /** | |
106 | * URL to Homepage. | |
107 | * | |
108 | * @var string | |
109 | */ | |
110 | public $url_homepage; | |
111 | /** | |
112 | * | |
113 | * @var string | |
114 | */ | |
115 | public $color_title; | |
116 | /** | |
117 | * | |
118 | * @var string | |
119 | */ | |
120 | public $color_button; | |
121 | /** | |
122 | * | |
123 | * @var string | |
124 | */ | |
125 | public $color_bar; | |
126 | /** | |
127 | * | |
128 | * @var string | |
129 | */ | |
130 | public $color_main_text; | |
131 | /** | |
132 | * | |
133 | * @var string | |
134 | */ | |
135 | public $color_main; | |
136 | /** | |
137 | * | |
138 | * @var string | |
139 | */ | |
140 | public $color_main_bg; | |
141 | /** | |
142 | * | |
143 | * @var string | |
144 | */ | |
145 | public $color_bg; | |
146 | /** | |
147 | * | |
148 | * @var string | |
149 | */ | |
150 | public $color_about_link; | |
151 | /** | |
152 | * | |
153 | * @var string | |
154 | */ | |
155 | public $color_homepage_link; | |
156 | /** | |
157 | * class constructor | |
158 | * | |
159 | * @return civicrm_contribution_widget | |
160 | */ | |
161 | function __construct() { | |
162 | $this->__table = 'civicrm_contribution_widget'; | |
163 | parent::__construct(); | |
164 | } | |
165 | /** | |
166 | * Returns foreign keys and entity references | |
167 | * | |
168 | * @return array | |
169 | * [CRM_Core_Reference_Interface] | |
170 | */ | |
171 | static function getReferenceColumns() { | |
172 | if (!self::$_links) { | |
173 | self::$_links = static ::createReferenceColumns(__CLASS__); | |
174 | self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'contribution_page_id', 'civicrm_contribution_page', 'id'); | |
175 | } | |
176 | return self::$_links; | |
177 | } | |
178 | /** | |
179 | * Returns all the column names of this table | |
180 | * | |
181 | * @return array | |
182 | */ | |
183 | static function &fields() { | |
184 | if (!(self::$_fields)) { | |
185 | self::$_fields = array( | |
186 | 'id' => array( | |
187 | 'name' => 'id', | |
188 | 'type' => CRM_Utils_Type::T_INT, | |
189 | 'title' => ts('Widget ID') , | |
190 | 'description' => 'Contribution Id', | |
191 | 'required' => true, | |
192 | ) , | |
193 | 'contribution_page_id' => array( | |
194 | 'name' => 'contribution_page_id', | |
195 | 'type' => CRM_Utils_Type::T_INT, | |
196 | 'title' => ts('Contribution Page') , | |
197 | 'description' => 'The Contribution Page which triggered this contribution', | |
198 | 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage', | |
199 | ) , | |
200 | 'is_active' => array( | |
201 | 'name' => 'is_active', | |
202 | 'type' => CRM_Utils_Type::T_BOOLEAN, | |
203 | 'title' => ts('Enabled?') , | |
204 | 'description' => 'Is this property active?', | |
205 | ) , | |
206 | 'title' => array( | |
207 | 'name' => 'title', | |
208 | 'type' => CRM_Utils_Type::T_STRING, | |
209 | 'title' => ts('Widget Title') , | |
210 | 'description' => 'Widget title.', | |
211 | 'maxlength' => 255, | |
212 | 'size' => CRM_Utils_Type::HUGE, | |
213 | ) , | |
214 | 'url_logo' => array( | |
215 | 'name' => 'url_logo', | |
216 | 'type' => CRM_Utils_Type::T_STRING, | |
217 | 'title' => ts('Widget Image Url') , | |
218 | 'description' => 'URL to Widget logo', | |
219 | 'maxlength' => 255, | |
220 | 'size' => CRM_Utils_Type::HUGE, | |
221 | ) , | |
222 | 'button_title' => array( | |
223 | 'name' => 'button_title', | |
224 | 'type' => CRM_Utils_Type::T_STRING, | |
225 | 'title' => ts('Button Title') , | |
226 | 'description' => 'Button title.', | |
227 | 'maxlength' => 255, | |
228 | 'size' => CRM_Utils_Type::HUGE, | |
229 | ) , | |
230 | 'about' => array( | |
231 | 'name' => 'about', | |
232 | 'type' => CRM_Utils_Type::T_TEXT, | |
233 | 'title' => ts('Description') , | |
234 | 'description' => 'About description.', | |
235 | ) , | |
236 | 'url_homepage' => array( | |
237 | 'name' => 'url_homepage', | |
238 | 'type' => CRM_Utils_Type::T_STRING, | |
239 | 'title' => ts('Homepage Url') , | |
240 | 'description' => 'URL to Homepage.', | |
241 | 'maxlength' => 255, | |
242 | 'size' => CRM_Utils_Type::HUGE, | |
243 | ) , | |
244 | 'color_title' => array( | |
245 | 'name' => 'color_title', | |
246 | 'type' => CRM_Utils_Type::T_STRING, | |
247 | 'title' => ts('Title Color') , | |
248 | 'maxlength' => 10, | |
249 | 'size' => CRM_Utils_Type::TWELVE, | |
250 | ) , | |
251 | 'color_button' => array( | |
252 | 'name' => 'color_button', | |
253 | 'type' => CRM_Utils_Type::T_STRING, | |
254 | 'title' => ts('Button Colour') , | |
255 | 'maxlength' => 10, | |
256 | 'size' => CRM_Utils_Type::TWELVE, | |
257 | ) , | |
258 | 'color_bar' => array( | |
259 | 'name' => 'color_bar', | |
260 | 'type' => CRM_Utils_Type::T_STRING, | |
261 | 'title' => ts('Bar Color') , | |
262 | 'maxlength' => 10, | |
263 | 'size' => CRM_Utils_Type::TWELVE, | |
264 | ) , | |
265 | 'color_main_text' => array( | |
266 | 'name' => 'color_main_text', | |
267 | 'type' => CRM_Utils_Type::T_STRING, | |
268 | 'title' => ts('Main Text Color') , | |
269 | 'maxlength' => 10, | |
270 | 'size' => CRM_Utils_Type::TWELVE, | |
271 | ) , | |
272 | 'color_main' => array( | |
273 | 'name' => 'color_main', | |
274 | 'type' => CRM_Utils_Type::T_STRING, | |
275 | 'title' => ts('Main Colour') , | |
276 | 'maxlength' => 10, | |
277 | 'size' => CRM_Utils_Type::TWELVE, | |
278 | ) , | |
279 | 'color_main_bg' => array( | |
280 | 'name' => 'color_main_bg', | |
281 | 'type' => CRM_Utils_Type::T_STRING, | |
282 | 'title' => ts('Backgroup Color') , | |
283 | 'maxlength' => 10, | |
284 | 'size' => CRM_Utils_Type::TWELVE, | |
285 | ) , | |
286 | 'color_bg' => array( | |
287 | 'name' => 'color_bg', | |
288 | 'type' => CRM_Utils_Type::T_STRING, | |
289 | 'title' => ts('Other Backgroun Colour') , | |
290 | 'maxlength' => 10, | |
291 | 'size' => CRM_Utils_Type::TWELVE, | |
292 | ) , | |
293 | 'color_about_link' => array( | |
294 | 'name' => 'color_about_link', | |
295 | 'type' => CRM_Utils_Type::T_STRING, | |
296 | 'title' => ts('About Link Colour') , | |
297 | 'maxlength' => 10, | |
298 | 'size' => CRM_Utils_Type::TWELVE, | |
299 | ) , | |
300 | 'color_homepage_link' => array( | |
301 | 'name' => 'color_homepage_link', | |
302 | 'type' => CRM_Utils_Type::T_STRING, | |
303 | 'title' => ts('Homepage Link Colour') , | |
304 | 'maxlength' => 10, | |
305 | 'size' => CRM_Utils_Type::TWELVE, | |
306 | ) , | |
307 | ); | |
308 | } | |
309 | return self::$_fields; | |
310 | } | |
311 | /** | |
bd8e0b14 | 312 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
313 | * |
314 | * @return array | |
bd8e0b14 | 315 | * Array(string $name => string $uniqueName). |
e501603b TO |
316 | */ |
317 | static function &fieldKeys() { | |
bd8e0b14 TO |
318 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
319 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 320 | } |
bd8e0b14 | 321 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b TO |
322 | } |
323 | /** | |
324 | * Returns the names of this table | |
325 | * | |
326 | * @return string | |
327 | */ | |
328 | static function getTableName() { | |
329 | return self::$_tableName; | |
330 | } | |
331 | /** | |
332 | * Returns if this table needs to be logged | |
333 | * | |
334 | * @return boolean | |
335 | */ | |
336 | function getLog() { | |
337 | return self::$_log; | |
338 | } | |
339 | /** | |
340 | * Returns the list of fields that can be imported | |
341 | * | |
342 | * @param bool $prefix | |
343 | * | |
344 | * @return array | |
345 | */ | |
346 | static function &import($prefix = false) { | |
60808919 TO |
347 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contribution_widget', $prefix, array()); |
348 | return $r; | |
e501603b TO |
349 | } |
350 | /** | |
351 | * Returns the list of fields that can be exported | |
352 | * | |
353 | * @param bool $prefix | |
354 | * | |
355 | * @return array | |
356 | */ | |
357 | static function &export($prefix = false) { | |
60808919 TO |
358 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contribution_widget', $prefix, array()); |
359 | return $r; | |
e501603b TO |
360 | } |
361 | } |