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