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