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