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