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