Merge pull request #15970 from eileenmcnaughton/ex_easy
[civicrm-core.git] / CRM / Contribute / DAO / Widget.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Contribute/Widget.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:a1f9bf066d659e32e32cd324aeb7a286)
10 */
11
12 /**
13 * Database access object for the Widget entity.
14 */
15 class CRM_Contribute_DAO_Widget extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_contribution_widget';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 public static $_log = TRUE;
30
31 /**
32 * Contribution Id
33 *
34 * @var int
35 */
36 public $id;
37
38 /**
39 * The Contribution Page which triggered this contribution
40 *
41 * @var int
42 */
43 public $contribution_page_id;
44
45 /**
46 * Is this property active?
47 *
48 * @var bool
49 */
50 public $is_active;
51
52 /**
53 * Widget title.
54 *
55 * @var string
56 */
57 public $title;
58
59 /**
60 * URL to Widget logo
61 *
62 * @var string
63 */
64 public $url_logo;
65
66 /**
67 * Button title.
68 *
69 * @var string
70 */
71 public $button_title;
72
73 /**
74 * About description.
75 *
76 * @var text
77 */
78 public $about;
79
80 /**
81 * URL to Homepage.
82 *
83 * @var string
84 */
85 public $url_homepage;
86
87 /**
88 * @var string
89 */
90 public $color_title;
91
92 /**
93 * @var string
94 */
95 public $color_button;
96
97 /**
98 * @var string
99 */
100 public $color_bar;
101
102 /**
103 * @var string
104 */
105 public $color_main_text;
106
107 /**
108 * @var string
109 */
110 public $color_main;
111
112 /**
113 * @var string
114 */
115 public $color_main_bg;
116
117 /**
118 * @var string
119 */
120 public $color_bg;
121
122 /**
123 * @var string
124 */
125 public $color_about_link;
126
127 /**
128 * @var string
129 */
130 public $color_homepage_link;
131
132 /**
133 * Class constructor.
134 */
135 public function __construct() {
136 $this->__table = 'civicrm_contribution_widget';
137 parent::__construct();
138 }
139
140 /**
141 * Returns foreign keys and entity references.
142 *
143 * @return array
144 * [CRM_Core_Reference_Interface]
145 */
146 public static function getReferenceColumns() {
147 if (!isset(Civi::$statics[__CLASS__]['links'])) {
148 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
149 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contribution_page_id', 'civicrm_contribution_page', 'id');
150 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
151 }
152 return Civi::$statics[__CLASS__]['links'];
153 }
154
155 /**
156 * Returns all the column names of this table
157 *
158 * @return array
159 */
160 public static function &fields() {
161 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
162 Civi::$statics[__CLASS__]['fields'] = [
163 'id' => [
164 'name' => 'id',
165 'type' => CRM_Utils_Type::T_INT,
166 'title' => ts('Widget ID'),
167 'description' => ts('Contribution Id'),
168 'required' => TRUE,
169 'where' => 'civicrm_contribution_widget.id',
170 'table_name' => 'civicrm_contribution_widget',
171 'entity' => 'Widget',
172 'bao' => 'CRM_Contribute_BAO_Widget',
173 'localizable' => 0,
174 ],
175 'contribution_page_id' => [
176 'name' => 'contribution_page_id',
177 'type' => CRM_Utils_Type::T_INT,
178 'title' => ts('Contribution Page'),
179 'description' => ts('The Contribution Page which triggered this contribution'),
180 'where' => 'civicrm_contribution_widget.contribution_page_id',
181 'table_name' => 'civicrm_contribution_widget',
182 'entity' => 'Widget',
183 'bao' => 'CRM_Contribute_BAO_Widget',
184 'localizable' => 0,
185 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
186 ],
187 'is_active' => [
188 'name' => 'is_active',
189 'type' => CRM_Utils_Type::T_BOOLEAN,
190 'title' => ts('Enabled?'),
191 'description' => ts('Is this property active?'),
192 'where' => 'civicrm_contribution_widget.is_active',
193 'table_name' => 'civicrm_contribution_widget',
194 'entity' => 'Widget',
195 'bao' => 'CRM_Contribute_BAO_Widget',
196 'localizable' => 0,
197 ],
198 'title' => [
199 'name' => 'title',
200 'type' => CRM_Utils_Type::T_STRING,
201 'title' => ts('Widget Title'),
202 'description' => ts('Widget title.'),
203 'maxlength' => 255,
204 'size' => CRM_Utils_Type::HUGE,
205 'where' => 'civicrm_contribution_widget.title',
206 'table_name' => 'civicrm_contribution_widget',
207 'entity' => 'Widget',
208 'bao' => 'CRM_Contribute_BAO_Widget',
209 'localizable' => 0,
210 ],
211 'url_logo' => [
212 'name' => 'url_logo',
213 'type' => CRM_Utils_Type::T_STRING,
214 'title' => ts('Widget Image Url'),
215 'description' => ts('URL to Widget logo'),
216 'maxlength' => 255,
217 'size' => CRM_Utils_Type::HUGE,
218 'where' => 'civicrm_contribution_widget.url_logo',
219 'table_name' => 'civicrm_contribution_widget',
220 'entity' => 'Widget',
221 'bao' => 'CRM_Contribute_BAO_Widget',
222 'localizable' => 0,
223 ],
224 'button_title' => [
225 'name' => 'button_title',
226 'type' => CRM_Utils_Type::T_STRING,
227 'title' => ts('Button Title'),
228 'description' => ts('Button title.'),
229 'maxlength' => 255,
230 'size' => CRM_Utils_Type::HUGE,
231 'where' => 'civicrm_contribution_widget.button_title',
232 'table_name' => 'civicrm_contribution_widget',
233 'entity' => 'Widget',
234 'bao' => 'CRM_Contribute_BAO_Widget',
235 'localizable' => 0,
236 ],
237 'about' => [
238 'name' => 'about',
239 'type' => CRM_Utils_Type::T_TEXT,
240 'title' => ts('Description'),
241 'description' => ts('About description.'),
242 'where' => 'civicrm_contribution_widget.about',
243 'table_name' => 'civicrm_contribution_widget',
244 'entity' => 'Widget',
245 'bao' => 'CRM_Contribute_BAO_Widget',
246 'localizable' => 0,
247 ],
248 'url_homepage' => [
249 'name' => 'url_homepage',
250 'type' => CRM_Utils_Type::T_STRING,
251 'title' => ts('Homepage Url'),
252 'description' => ts('URL to Homepage.'),
253 'maxlength' => 255,
254 'size' => CRM_Utils_Type::HUGE,
255 'where' => 'civicrm_contribution_widget.url_homepage',
256 'table_name' => 'civicrm_contribution_widget',
257 'entity' => 'Widget',
258 'bao' => 'CRM_Contribute_BAO_Widget',
259 'localizable' => 0,
260 ],
261 'color_title' => [
262 'name' => 'color_title',
263 'type' => CRM_Utils_Type::T_STRING,
264 'title' => ts('Title Color'),
265 'maxlength' => 10,
266 'size' => CRM_Utils_Type::TWELVE,
267 'where' => 'civicrm_contribution_widget.color_title',
268 'table_name' => 'civicrm_contribution_widget',
269 'entity' => 'Widget',
270 'bao' => 'CRM_Contribute_BAO_Widget',
271 'localizable' => 0,
272 ],
273 'color_button' => [
274 'name' => 'color_button',
275 'type' => CRM_Utils_Type::T_STRING,
276 'title' => ts('Button Colour'),
277 'maxlength' => 10,
278 'size' => CRM_Utils_Type::TWELVE,
279 'where' => 'civicrm_contribution_widget.color_button',
280 'table_name' => 'civicrm_contribution_widget',
281 'entity' => 'Widget',
282 'bao' => 'CRM_Contribute_BAO_Widget',
283 'localizable' => 0,
284 ],
285 'color_bar' => [
286 'name' => 'color_bar',
287 'type' => CRM_Utils_Type::T_STRING,
288 'title' => ts('Bar Color'),
289 'maxlength' => 10,
290 'size' => CRM_Utils_Type::TWELVE,
291 'where' => 'civicrm_contribution_widget.color_bar',
292 'table_name' => 'civicrm_contribution_widget',
293 'entity' => 'Widget',
294 'bao' => 'CRM_Contribute_BAO_Widget',
295 'localizable' => 0,
296 ],
297 'color_main_text' => [
298 'name' => 'color_main_text',
299 'type' => CRM_Utils_Type::T_STRING,
300 'title' => ts('Main Text Color'),
301 'maxlength' => 10,
302 'size' => CRM_Utils_Type::TWELVE,
303 'where' => 'civicrm_contribution_widget.color_main_text',
304 'table_name' => 'civicrm_contribution_widget',
305 'entity' => 'Widget',
306 'bao' => 'CRM_Contribute_BAO_Widget',
307 'localizable' => 0,
308 ],
309 'color_main' => [
310 'name' => 'color_main',
311 'type' => CRM_Utils_Type::T_STRING,
312 'title' => ts('Main Colour'),
313 'maxlength' => 10,
314 'size' => CRM_Utils_Type::TWELVE,
315 'where' => 'civicrm_contribution_widget.color_main',
316 'table_name' => 'civicrm_contribution_widget',
317 'entity' => 'Widget',
318 'bao' => 'CRM_Contribute_BAO_Widget',
319 'localizable' => 0,
320 ],
321 'color_main_bg' => [
322 'name' => 'color_main_bg',
323 'type' => CRM_Utils_Type::T_STRING,
324 'title' => ts('Backgroup Color'),
325 'maxlength' => 10,
326 'size' => CRM_Utils_Type::TWELVE,
327 'where' => 'civicrm_contribution_widget.color_main_bg',
328 'table_name' => 'civicrm_contribution_widget',
329 'entity' => 'Widget',
330 'bao' => 'CRM_Contribute_BAO_Widget',
331 'localizable' => 0,
332 ],
333 'color_bg' => [
334 'name' => 'color_bg',
335 'type' => CRM_Utils_Type::T_STRING,
336 'title' => ts('Other Backgroun Colour'),
337 'maxlength' => 10,
338 'size' => CRM_Utils_Type::TWELVE,
339 'where' => 'civicrm_contribution_widget.color_bg',
340 'table_name' => 'civicrm_contribution_widget',
341 'entity' => 'Widget',
342 'bao' => 'CRM_Contribute_BAO_Widget',
343 'localizable' => 0,
344 ],
345 'color_about_link' => [
346 'name' => 'color_about_link',
347 'type' => CRM_Utils_Type::T_STRING,
348 'title' => ts('About Link Colour'),
349 'maxlength' => 10,
350 'size' => CRM_Utils_Type::TWELVE,
351 'where' => 'civicrm_contribution_widget.color_about_link',
352 'table_name' => 'civicrm_contribution_widget',
353 'entity' => 'Widget',
354 'bao' => 'CRM_Contribute_BAO_Widget',
355 'localizable' => 0,
356 ],
357 'color_homepage_link' => [
358 'name' => 'color_homepage_link',
359 'type' => CRM_Utils_Type::T_STRING,
360 'title' => ts('Homepage Link Colour'),
361 'maxlength' => 10,
362 'size' => CRM_Utils_Type::TWELVE,
363 'where' => 'civicrm_contribution_widget.color_homepage_link',
364 'table_name' => 'civicrm_contribution_widget',
365 'entity' => 'Widget',
366 'bao' => 'CRM_Contribute_BAO_Widget',
367 'localizable' => 0,
368 ],
369 ];
370 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
371 }
372 return Civi::$statics[__CLASS__]['fields'];
373 }
374
375 /**
376 * Return a mapping from field-name to the corresponding key (as used in fields()).
377 *
378 * @return array
379 * Array(string $name => string $uniqueName).
380 */
381 public static function &fieldKeys() {
382 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
383 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
384 }
385 return Civi::$statics[__CLASS__]['fieldKeys'];
386 }
387
388 /**
389 * Returns the names of this table
390 *
391 * @return string
392 */
393 public static function getTableName() {
394 return self::$_tableName;
395 }
396
397 /**
398 * Returns if this table needs to be logged
399 *
400 * @return bool
401 */
402 public function getLog() {
403 return self::$_log;
404 }
405
406 /**
407 * Returns the list of fields that can be imported
408 *
409 * @param bool $prefix
410 *
411 * @return array
412 */
413 public static function &import($prefix = FALSE) {
414 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contribution_widget', $prefix, []);
415 return $r;
416 }
417
418 /**
419 * Returns the list of fields that can be exported
420 *
421 * @param bool $prefix
422 *
423 * @return array
424 */
425 public static function &export($prefix = FALSE) {
426 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contribution_widget', $prefix, []);
427 return $r;
428 }
429
430 /**
431 * Returns the list of indices
432 *
433 * @param bool $localize
434 *
435 * @return array
436 */
437 public static function indices($localize = TRUE) {
438 $indices = [];
439 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
440 }
441
442 }