5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Contribute/Widget.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:8327209557468328fd4ec358866fdab0)
13 * Database access object for the Widget entity.
15 class CRM_Contribute_DAO_Widget
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '2.0';
18 const COMPONENT
= 'CiviContribute';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_contribution_widget';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = TRUE;
37 * @var int|string|null
38 * (SQL type: int unsigned)
39 * Note that values will be retrieved from the database as a string.
44 * The Contribution Page which triggered this contribution
46 * @var int|string|null
47 * (SQL type: int unsigned)
48 * Note that values will be retrieved from the database as a string.
50 public $contribution_page_id;
53 * Is this property active?
57 * Note that values will be retrieved from the database as a string.
65 * (SQL type: varchar(255))
66 * Note that values will be retrieved from the database as a string.
74 * (SQL type: varchar(255))
75 * Note that values will be retrieved from the database as a string.
83 * (SQL type: varchar(255))
84 * Note that values will be retrieved from the database as a string.
93 * Note that values will be retrieved from the database as a string.
101 * (SQL type: varchar(255))
102 * Note that values will be retrieved from the database as a string.
104 public $url_homepage;
108 * (SQL type: varchar(10))
109 * Note that values will be retrieved from the database as a string.
115 * (SQL type: varchar(10))
116 * Note that values will be retrieved from the database as a string.
118 public $color_button;
122 * (SQL type: varchar(10))
123 * Note that values will be retrieved from the database as a string.
129 * (SQL type: varchar(10))
130 * Note that values will be retrieved from the database as a string.
132 public $color_main_text;
136 * (SQL type: varchar(10))
137 * Note that values will be retrieved from the database as a string.
143 * (SQL type: varchar(10))
144 * Note that values will be retrieved from the database as a string.
146 public $color_main_bg;
150 * (SQL type: varchar(10))
151 * Note that values will be retrieved from the database as a string.
157 * (SQL type: varchar(10))
158 * Note that values will be retrieved from the database as a string.
160 public $color_about_link;
164 * (SQL type: varchar(10))
165 * Note that values will be retrieved from the database as a string.
167 public $color_homepage_link;
172 public function __construct() {
173 $this->__table
= 'civicrm_contribution_widget';
174 parent
::__construct();
178 * Returns localized title of this entity.
180 * @param bool $plural
181 * Whether to return the plural version of the title.
183 public static function getEntityTitle($plural = FALSE) {
184 return $plural ?
ts('Widgets') : ts('Widget');
188 * Returns foreign keys and entity references.
191 * [CRM_Core_Reference_Interface]
193 public static function getReferenceColumns() {
194 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
195 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
196 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contribution_page_id', 'civicrm_contribution_page', 'id');
197 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
199 return Civi
::$statics[__CLASS__
]['links'];
203 * Returns all the column names of this table
207 public static function &fields() {
208 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
209 Civi
::$statics[__CLASS__
]['fields'] = [
212 'type' => CRM_Utils_Type
::T_INT
,
213 'title' => ts('Widget ID'),
214 'description' => ts('Contribution ID'),
216 'where' => 'civicrm_contribution_widget.id',
217 'table_name' => 'civicrm_contribution_widget',
218 'entity' => 'Widget',
219 'bao' => 'CRM_Contribute_BAO_Widget',
227 'contribution_page_id' => [
228 'name' => 'contribution_page_id',
229 'type' => CRM_Utils_Type
::T_INT
,
230 'title' => ts('Contribution Page ID'),
231 'description' => ts('The Contribution Page which triggered this contribution'),
232 'where' => 'civicrm_contribution_widget.contribution_page_id',
233 'table_name' => 'civicrm_contribution_widget',
234 'entity' => 'Widget',
235 'bao' => 'CRM_Contribute_BAO_Widget',
237 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
239 'label' => ts("Contribution Page"),
244 'name' => 'is_active',
245 'type' => CRM_Utils_Type
::T_BOOLEAN
,
246 'title' => ts('Enabled?'),
247 'description' => ts('Is this property active?'),
249 'where' => 'civicrm_contribution_widget.is_active',
251 'table_name' => 'civicrm_contribution_widget',
252 'entity' => 'Widget',
253 'bao' => 'CRM_Contribute_BAO_Widget',
259 'type' => CRM_Utils_Type
::T_STRING
,
260 'title' => ts('Widget Title'),
261 'description' => ts('Widget title.'),
263 'size' => CRM_Utils_Type
::HUGE
,
264 'where' => 'civicrm_contribution_widget.title',
265 'table_name' => 'civicrm_contribution_widget',
266 'entity' => 'Widget',
267 'bao' => 'CRM_Contribute_BAO_Widget',
272 'name' => 'url_logo',
273 'type' => CRM_Utils_Type
::T_STRING
,
274 'title' => ts('Widget Image Url'),
275 'description' => ts('URL to Widget logo'),
277 'size' => CRM_Utils_Type
::HUGE
,
278 'where' => 'civicrm_contribution_widget.url_logo',
279 'table_name' => 'civicrm_contribution_widget',
280 'entity' => 'Widget',
281 'bao' => 'CRM_Contribute_BAO_Widget',
286 'name' => 'button_title',
287 'type' => CRM_Utils_Type
::T_STRING
,
288 'title' => ts('Button Title'),
289 'description' => ts('Button title.'),
291 'size' => CRM_Utils_Type
::HUGE
,
292 'where' => 'civicrm_contribution_widget.button_title',
293 'table_name' => 'civicrm_contribution_widget',
294 'entity' => 'Widget',
295 'bao' => 'CRM_Contribute_BAO_Widget',
301 'type' => CRM_Utils_Type
::T_TEXT
,
302 'title' => ts('Description'),
303 'description' => ts('About description.'),
304 'where' => 'civicrm_contribution_widget.about',
305 'table_name' => 'civicrm_contribution_widget',
306 'entity' => 'Widget',
307 'bao' => 'CRM_Contribute_BAO_Widget',
312 'name' => 'url_homepage',
313 'type' => CRM_Utils_Type
::T_STRING
,
314 'title' => ts('Homepage Url'),
315 'description' => ts('URL to Homepage.'),
317 'size' => CRM_Utils_Type
::HUGE
,
318 'where' => 'civicrm_contribution_widget.url_homepage',
319 'table_name' => 'civicrm_contribution_widget',
320 'entity' => 'Widget',
321 'bao' => 'CRM_Contribute_BAO_Widget',
326 'name' => 'color_title',
327 'type' => CRM_Utils_Type
::T_STRING
,
328 'title' => ts('Title Color'),
330 'size' => CRM_Utils_Type
::TWELVE
,
331 'where' => 'civicrm_contribution_widget.color_title',
332 'table_name' => 'civicrm_contribution_widget',
333 'entity' => 'Widget',
334 'bao' => 'CRM_Contribute_BAO_Widget',
339 'name' => 'color_button',
340 'type' => CRM_Utils_Type
::T_STRING
,
341 'title' => ts('Button Color'),
343 'size' => CRM_Utils_Type
::TWELVE
,
344 'where' => 'civicrm_contribution_widget.color_button',
345 'table_name' => 'civicrm_contribution_widget',
346 'entity' => 'Widget',
347 'bao' => 'CRM_Contribute_BAO_Widget',
352 'name' => 'color_bar',
353 'type' => CRM_Utils_Type
::T_STRING
,
354 'title' => ts('Bar Color'),
356 'size' => CRM_Utils_Type
::TWELVE
,
357 'where' => 'civicrm_contribution_widget.color_bar',
358 'table_name' => 'civicrm_contribution_widget',
359 'entity' => 'Widget',
360 'bao' => 'CRM_Contribute_BAO_Widget',
364 'color_main_text' => [
365 'name' => 'color_main_text',
366 'type' => CRM_Utils_Type
::T_STRING
,
367 'title' => ts('Main Text Color'),
369 'size' => CRM_Utils_Type
::TWELVE
,
370 'where' => 'civicrm_contribution_widget.color_main_text',
371 'table_name' => 'civicrm_contribution_widget',
372 'entity' => 'Widget',
373 'bao' => 'CRM_Contribute_BAO_Widget',
378 'name' => 'color_main',
379 'type' => CRM_Utils_Type
::T_STRING
,
380 'title' => ts('Main Color'),
382 'size' => CRM_Utils_Type
::TWELVE
,
383 'where' => 'civicrm_contribution_widget.color_main',
384 'table_name' => 'civicrm_contribution_widget',
385 'entity' => 'Widget',
386 'bao' => 'CRM_Contribute_BAO_Widget',
391 'name' => 'color_main_bg',
392 'type' => CRM_Utils_Type
::T_STRING
,
393 'title' => ts('Background Color'),
395 'size' => CRM_Utils_Type
::TWELVE
,
396 'where' => 'civicrm_contribution_widget.color_main_bg',
397 'table_name' => 'civicrm_contribution_widget',
398 'entity' => 'Widget',
399 'bao' => 'CRM_Contribute_BAO_Widget',
404 'name' => 'color_bg',
405 'type' => CRM_Utils_Type
::T_STRING
,
406 'title' => ts('Other Background Color'),
408 'size' => CRM_Utils_Type
::TWELVE
,
409 'where' => 'civicrm_contribution_widget.color_bg',
410 'table_name' => 'civicrm_contribution_widget',
411 'entity' => 'Widget',
412 'bao' => 'CRM_Contribute_BAO_Widget',
416 'color_about_link' => [
417 'name' => 'color_about_link',
418 'type' => CRM_Utils_Type
::T_STRING
,
419 'title' => ts('About Link Color'),
421 'size' => CRM_Utils_Type
::TWELVE
,
422 'where' => 'civicrm_contribution_widget.color_about_link',
423 'table_name' => 'civicrm_contribution_widget',
424 'entity' => 'Widget',
425 'bao' => 'CRM_Contribute_BAO_Widget',
429 'color_homepage_link' => [
430 'name' => 'color_homepage_link',
431 'type' => CRM_Utils_Type
::T_STRING
,
432 'title' => ts('Homepage Link Color'),
434 'size' => CRM_Utils_Type
::TWELVE
,
435 'where' => 'civicrm_contribution_widget.color_homepage_link',
436 'table_name' => 'civicrm_contribution_widget',
437 'entity' => 'Widget',
438 'bao' => 'CRM_Contribute_BAO_Widget',
443 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
445 return Civi
::$statics[__CLASS__
]['fields'];
449 * Return a mapping from field-name to the corresponding key (as used in fields()).
452 * Array(string $name => string $uniqueName).
454 public static function &fieldKeys() {
455 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
456 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
458 return Civi
::$statics[__CLASS__
]['fieldKeys'];
462 * Returns the names of this table
466 public static function getTableName() {
467 return self
::$_tableName;
471 * Returns if this table needs to be logged
475 public function getLog() {
480 * Returns the list of fields that can be imported
482 * @param bool $prefix
486 public static function &import($prefix = FALSE) {
487 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution_widget', $prefix, []);
492 * Returns the list of fields that can be exported
494 * @param bool $prefix
498 public static function &export($prefix = FALSE) {
499 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution_widget', $prefix, []);
504 * Returns the list of indices
506 * @param bool $localize
510 public static function indices($localize = TRUE) {
512 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;