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