API/DAO Metadata - Retain versioning metadata for possible usage in runtime+tooling
[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:b0e7180701d83e1d83d53bf2e43c0c51)
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 localized title of this entity.
142 */
143 public static function getEntityTitle() {
144 return ts('Widgets');
145 }
146
147 /**
148 * Returns foreign keys and entity references.
149 *
150 * @return array
151 * [CRM_Core_Reference_Interface]
152 */
153 public static function getReferenceColumns() {
154 if (!isset(Civi::$statics[__CLASS__]['links'])) {
155 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
156 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'contribution_page_id', 'civicrm_contribution_page', 'id');
157 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
158 }
159 return Civi::$statics[__CLASS__]['links'];
160 }
161
162 /**
163 * Returns all the column names of this table
164 *
165 * @return array
166 */
167 public static function &fields() {
168 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
169 Civi::$statics[__CLASS__]['fields'] = [
170 'id' => [
171 'name' => 'id',
172 'type' => CRM_Utils_Type::T_INT,
173 'title' => ts('Widget ID'),
174 'description' => ts('Contribution Id'),
175 'required' => TRUE,
176 'where' => 'civicrm_contribution_widget.id',
177 'table_name' => 'civicrm_contribution_widget',
178 'entity' => 'Widget',
179 'bao' => 'CRM_Contribute_BAO_Widget',
180 'localizable' => 0,
181 'add' => '2.0',
182 ],
183 'contribution_page_id' => [
184 'name' => 'contribution_page_id',
185 'type' => CRM_Utils_Type::T_INT,
186 'title' => ts('Contribution Page'),
187 'description' => ts('The Contribution Page which triggered this contribution'),
188 'where' => 'civicrm_contribution_widget.contribution_page_id',
189 'table_name' => 'civicrm_contribution_widget',
190 'entity' => 'Widget',
191 'bao' => 'CRM_Contribute_BAO_Widget',
192 'localizable' => 0,
193 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
194 'add' => '1.5',
195 ],
196 'is_active' => [
197 'name' => 'is_active',
198 'type' => CRM_Utils_Type::T_BOOLEAN,
199 'title' => ts('Enabled?'),
200 'description' => ts('Is this property active?'),
201 'where' => 'civicrm_contribution_widget.is_active',
202 'table_name' => 'civicrm_contribution_widget',
203 'entity' => 'Widget',
204 'bao' => 'CRM_Contribute_BAO_Widget',
205 'localizable' => 0,
206 'add' => '2.0',
207 ],
208 'title' => [
209 'name' => 'title',
210 'type' => CRM_Utils_Type::T_STRING,
211 'title' => ts('Widget Title'),
212 'description' => ts('Widget title.'),
213 'maxlength' => 255,
214 'size' => CRM_Utils_Type::HUGE,
215 'where' => 'civicrm_contribution_widget.title',
216 'table_name' => 'civicrm_contribution_widget',
217 'entity' => 'Widget',
218 'bao' => 'CRM_Contribute_BAO_Widget',
219 'localizable' => 0,
220 'add' => '2.0',
221 ],
222 'url_logo' => [
223 'name' => 'url_logo',
224 'type' => CRM_Utils_Type::T_STRING,
225 'title' => ts('Widget Image Url'),
226 'description' => ts('URL to Widget logo'),
227 'maxlength' => 255,
228 'size' => CRM_Utils_Type::HUGE,
229 'where' => 'civicrm_contribution_widget.url_logo',
230 'table_name' => 'civicrm_contribution_widget',
231 'entity' => 'Widget',
232 'bao' => 'CRM_Contribute_BAO_Widget',
233 'localizable' => 0,
234 'add' => '2.0',
235 ],
236 'button_title' => [
237 'name' => 'button_title',
238 'type' => CRM_Utils_Type::T_STRING,
239 'title' => ts('Button Title'),
240 'description' => ts('Button title.'),
241 'maxlength' => 255,
242 'size' => CRM_Utils_Type::HUGE,
243 'where' => 'civicrm_contribution_widget.button_title',
244 'table_name' => 'civicrm_contribution_widget',
245 'entity' => 'Widget',
246 'bao' => 'CRM_Contribute_BAO_Widget',
247 'localizable' => 0,
248 'add' => '2.0',
249 ],
250 'about' => [
251 'name' => 'about',
252 'type' => CRM_Utils_Type::T_TEXT,
253 'title' => ts('Description'),
254 'description' => ts('About description.'),
255 'where' => 'civicrm_contribution_widget.about',
256 'table_name' => 'civicrm_contribution_widget',
257 'entity' => 'Widget',
258 'bao' => 'CRM_Contribute_BAO_Widget',
259 'localizable' => 0,
260 'add' => '2.0',
261 ],
262 'url_homepage' => [
263 'name' => 'url_homepage',
264 'type' => CRM_Utils_Type::T_STRING,
265 'title' => ts('Homepage Url'),
266 'description' => ts('URL to Homepage.'),
267 'maxlength' => 255,
268 'size' => CRM_Utils_Type::HUGE,
269 'where' => 'civicrm_contribution_widget.url_homepage',
270 'table_name' => 'civicrm_contribution_widget',
271 'entity' => 'Widget',
272 'bao' => 'CRM_Contribute_BAO_Widget',
273 'localizable' => 0,
274 'add' => '2.0',
275 ],
276 'color_title' => [
277 'name' => 'color_title',
278 'type' => CRM_Utils_Type::T_STRING,
279 'title' => ts('Title Color'),
280 'maxlength' => 10,
281 'size' => CRM_Utils_Type::TWELVE,
282 'where' => 'civicrm_contribution_widget.color_title',
283 'table_name' => 'civicrm_contribution_widget',
284 'entity' => 'Widget',
285 'bao' => 'CRM_Contribute_BAO_Widget',
286 'localizable' => 0,
287 'add' => '2.0',
288 ],
289 'color_button' => [
290 'name' => 'color_button',
291 'type' => CRM_Utils_Type::T_STRING,
292 'title' => ts('Button Color'),
293 'maxlength' => 10,
294 'size' => CRM_Utils_Type::TWELVE,
295 'where' => 'civicrm_contribution_widget.color_button',
296 'table_name' => 'civicrm_contribution_widget',
297 'entity' => 'Widget',
298 'bao' => 'CRM_Contribute_BAO_Widget',
299 'localizable' => 0,
300 'add' => '2.0',
301 ],
302 'color_bar' => [
303 'name' => 'color_bar',
304 'type' => CRM_Utils_Type::T_STRING,
305 'title' => ts('Bar Color'),
306 'maxlength' => 10,
307 'size' => CRM_Utils_Type::TWELVE,
308 'where' => 'civicrm_contribution_widget.color_bar',
309 'table_name' => 'civicrm_contribution_widget',
310 'entity' => 'Widget',
311 'bao' => 'CRM_Contribute_BAO_Widget',
312 'localizable' => 0,
313 'add' => '2.0',
314 ],
315 'color_main_text' => [
316 'name' => 'color_main_text',
317 'type' => CRM_Utils_Type::T_STRING,
318 'title' => ts('Main Text Color'),
319 'maxlength' => 10,
320 'size' => CRM_Utils_Type::TWELVE,
321 'where' => 'civicrm_contribution_widget.color_main_text',
322 'table_name' => 'civicrm_contribution_widget',
323 'entity' => 'Widget',
324 'bao' => 'CRM_Contribute_BAO_Widget',
325 'localizable' => 0,
326 'add' => '2.0',
327 ],
328 'color_main' => [
329 'name' => 'color_main',
330 'type' => CRM_Utils_Type::T_STRING,
331 'title' => ts('Main Color'),
332 'maxlength' => 10,
333 'size' => CRM_Utils_Type::TWELVE,
334 'where' => 'civicrm_contribution_widget.color_main',
335 'table_name' => 'civicrm_contribution_widget',
336 'entity' => 'Widget',
337 'bao' => 'CRM_Contribute_BAO_Widget',
338 'localizable' => 0,
339 'add' => '2.0',
340 ],
341 'color_main_bg' => [
342 'name' => 'color_main_bg',
343 'type' => CRM_Utils_Type::T_STRING,
344 'title' => ts('Background Color'),
345 'maxlength' => 10,
346 'size' => CRM_Utils_Type::TWELVE,
347 'where' => 'civicrm_contribution_widget.color_main_bg',
348 'table_name' => 'civicrm_contribution_widget',
349 'entity' => 'Widget',
350 'bao' => 'CRM_Contribute_BAO_Widget',
351 'localizable' => 0,
352 'add' => '2.0',
353 ],
354 'color_bg' => [
355 'name' => 'color_bg',
356 'type' => CRM_Utils_Type::T_STRING,
357 'title' => ts('Other Background Color'),
358 'maxlength' => 10,
359 'size' => CRM_Utils_Type::TWELVE,
360 'where' => 'civicrm_contribution_widget.color_bg',
361 'table_name' => 'civicrm_contribution_widget',
362 'entity' => 'Widget',
363 'bao' => 'CRM_Contribute_BAO_Widget',
364 'localizable' => 0,
365 'add' => '2.0',
366 ],
367 'color_about_link' => [
368 'name' => 'color_about_link',
369 'type' => CRM_Utils_Type::T_STRING,
370 'title' => ts('About Link Color'),
371 'maxlength' => 10,
372 'size' => CRM_Utils_Type::TWELVE,
373 'where' => 'civicrm_contribution_widget.color_about_link',
374 'table_name' => 'civicrm_contribution_widget',
375 'entity' => 'Widget',
376 'bao' => 'CRM_Contribute_BAO_Widget',
377 'localizable' => 0,
378 'add' => '2.0',
379 ],
380 'color_homepage_link' => [
381 'name' => 'color_homepage_link',
382 'type' => CRM_Utils_Type::T_STRING,
383 'title' => ts('Homepage Link Color'),
384 'maxlength' => 10,
385 'size' => CRM_Utils_Type::TWELVE,
386 'where' => 'civicrm_contribution_widget.color_homepage_link',
387 'table_name' => 'civicrm_contribution_widget',
388 'entity' => 'Widget',
389 'bao' => 'CRM_Contribute_BAO_Widget',
390 'localizable' => 0,
391 'add' => '2.0',
392 ],
393 ];
394 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
395 }
396 return Civi::$statics[__CLASS__]['fields'];
397 }
398
399 /**
400 * Return a mapping from field-name to the corresponding key (as used in fields()).
401 *
402 * @return array
403 * Array(string $name => string $uniqueName).
404 */
405 public static function &fieldKeys() {
406 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
407 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
408 }
409 return Civi::$statics[__CLASS__]['fieldKeys'];
410 }
411
412 /**
413 * Returns the names of this table
414 *
415 * @return string
416 */
417 public static function getTableName() {
418 return self::$_tableName;
419 }
420
421 /**
422 * Returns if this table needs to be logged
423 *
424 * @return bool
425 */
426 public function getLog() {
427 return self::$_log;
428 }
429
430 /**
431 * Returns the list of fields that can be imported
432 *
433 * @param bool $prefix
434 *
435 * @return array
436 */
437 public static function &import($prefix = FALSE) {
438 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contribution_widget', $prefix, []);
439 return $r;
440 }
441
442 /**
443 * Returns the list of fields that can be exported
444 *
445 * @param bool $prefix
446 *
447 * @return array
448 */
449 public static function &export($prefix = FALSE) {
450 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contribution_widget', $prefix, []);
451 return $r;
452 }
453
454 /**
455 * Returns the list of indices
456 *
457 * @param bool $localize
458 *
459 * @return array
460 */
461 public static function indices($localize = TRUE) {
462 $indices = [];
463 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
464 }
465
466 }