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