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:68cffd0a5158d8a8d052556b9d4d6d7b)
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;
42 * The Contribution Page which triggered this contribution
46 public $contribution_page_id;
49 * Is this property active?
108 public $color_main_text;
118 public $color_main_bg;
128 public $color_about_link;
133 public $color_homepage_link;
138 public function __construct() {
139 $this->__table
= 'civicrm_contribution_widget';
140 parent
::__construct();
144 * Returns localized title of this entity.
146 * @param bool $plural
147 * Whether to return the plural version of the title.
149 public static function getEntityTitle($plural = FALSE) {
150 return $plural ?
ts('Widgets') : ts('Widget');
154 * Returns foreign keys and entity references.
157 * [CRM_Core_Reference_Interface]
159 public static function getReferenceColumns() {
160 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
161 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
162 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contribution_page_id', 'civicrm_contribution_page', 'id');
163 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
165 return Civi
::$statics[__CLASS__
]['links'];
169 * Returns all the column names of this table
173 public static function &fields() {
174 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
175 Civi
::$statics[__CLASS__
]['fields'] = [
178 'type' => CRM_Utils_Type
::T_INT
,
179 'title' => ts('Widget ID'),
180 'description' => ts('Contribution ID'),
182 'where' => 'civicrm_contribution_widget.id',
183 'table_name' => 'civicrm_contribution_widget',
184 'entity' => 'Widget',
185 'bao' => 'CRM_Contribute_BAO_Widget',
193 'contribution_page_id' => [
194 'name' => 'contribution_page_id',
195 'type' => CRM_Utils_Type
::T_INT
,
196 'title' => ts('Contribution Page ID'),
197 'description' => ts('The Contribution Page which triggered this contribution'),
198 'where' => 'civicrm_contribution_widget.contribution_page_id',
199 'table_name' => 'civicrm_contribution_widget',
200 'entity' => 'Widget',
201 'bao' => 'CRM_Contribute_BAO_Widget',
203 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
205 'label' => ts("Contribution Page"),
210 'name' => 'is_active',
211 'type' => CRM_Utils_Type
::T_BOOLEAN
,
212 'title' => ts('Enabled?'),
213 'description' => ts('Is this property active?'),
214 'where' => 'civicrm_contribution_widget.is_active',
215 'table_name' => 'civicrm_contribution_widget',
216 'entity' => 'Widget',
217 'bao' => 'CRM_Contribute_BAO_Widget',
223 'type' => CRM_Utils_Type
::T_STRING
,
224 'title' => ts('Widget Title'),
225 'description' => ts('Widget title.'),
227 'size' => CRM_Utils_Type
::HUGE
,
228 'where' => 'civicrm_contribution_widget.title',
229 'table_name' => 'civicrm_contribution_widget',
230 'entity' => 'Widget',
231 'bao' => 'CRM_Contribute_BAO_Widget',
236 'name' => 'url_logo',
237 'type' => CRM_Utils_Type
::T_STRING
,
238 'title' => ts('Widget Image Url'),
239 'description' => ts('URL to Widget logo'),
241 'size' => CRM_Utils_Type
::HUGE
,
242 'where' => 'civicrm_contribution_widget.url_logo',
243 'table_name' => 'civicrm_contribution_widget',
244 'entity' => 'Widget',
245 'bao' => 'CRM_Contribute_BAO_Widget',
250 'name' => 'button_title',
251 'type' => CRM_Utils_Type
::T_STRING
,
252 'title' => ts('Button Title'),
253 'description' => ts('Button title.'),
255 'size' => CRM_Utils_Type
::HUGE
,
256 'where' => 'civicrm_contribution_widget.button_title',
257 'table_name' => 'civicrm_contribution_widget',
258 'entity' => 'Widget',
259 'bao' => 'CRM_Contribute_BAO_Widget',
265 'type' => CRM_Utils_Type
::T_TEXT
,
266 'title' => ts('Description'),
267 'description' => ts('About description.'),
268 'where' => 'civicrm_contribution_widget.about',
269 'table_name' => 'civicrm_contribution_widget',
270 'entity' => 'Widget',
271 'bao' => 'CRM_Contribute_BAO_Widget',
276 'name' => 'url_homepage',
277 'type' => CRM_Utils_Type
::T_STRING
,
278 'title' => ts('Homepage Url'),
279 'description' => ts('URL to Homepage.'),
281 'size' => CRM_Utils_Type
::HUGE
,
282 'where' => 'civicrm_contribution_widget.url_homepage',
283 'table_name' => 'civicrm_contribution_widget',
284 'entity' => 'Widget',
285 'bao' => 'CRM_Contribute_BAO_Widget',
290 'name' => 'color_title',
291 'type' => CRM_Utils_Type
::T_STRING
,
292 'title' => ts('Title Color'),
294 'size' => CRM_Utils_Type
::TWELVE
,
295 'where' => 'civicrm_contribution_widget.color_title',
296 'table_name' => 'civicrm_contribution_widget',
297 'entity' => 'Widget',
298 'bao' => 'CRM_Contribute_BAO_Widget',
303 'name' => 'color_button',
304 'type' => CRM_Utils_Type
::T_STRING
,
305 'title' => ts('Button Color'),
307 'size' => CRM_Utils_Type
::TWELVE
,
308 'where' => 'civicrm_contribution_widget.color_button',
309 'table_name' => 'civicrm_contribution_widget',
310 'entity' => 'Widget',
311 'bao' => 'CRM_Contribute_BAO_Widget',
316 'name' => 'color_bar',
317 'type' => CRM_Utils_Type
::T_STRING
,
318 'title' => ts('Bar Color'),
320 'size' => CRM_Utils_Type
::TWELVE
,
321 'where' => 'civicrm_contribution_widget.color_bar',
322 'table_name' => 'civicrm_contribution_widget',
323 'entity' => 'Widget',
324 'bao' => 'CRM_Contribute_BAO_Widget',
328 'color_main_text' => [
329 'name' => 'color_main_text',
330 'type' => CRM_Utils_Type
::T_STRING
,
331 'title' => ts('Main Text Color'),
333 'size' => CRM_Utils_Type
::TWELVE
,
334 'where' => 'civicrm_contribution_widget.color_main_text',
335 'table_name' => 'civicrm_contribution_widget',
336 'entity' => 'Widget',
337 'bao' => 'CRM_Contribute_BAO_Widget',
342 'name' => 'color_main',
343 'type' => CRM_Utils_Type
::T_STRING
,
344 'title' => ts('Main Color'),
346 'size' => CRM_Utils_Type
::TWELVE
,
347 'where' => 'civicrm_contribution_widget.color_main',
348 'table_name' => 'civicrm_contribution_widget',
349 'entity' => 'Widget',
350 'bao' => 'CRM_Contribute_BAO_Widget',
355 'name' => 'color_main_bg',
356 'type' => CRM_Utils_Type
::T_STRING
,
357 'title' => ts('Background Color'),
359 'size' => CRM_Utils_Type
::TWELVE
,
360 'where' => 'civicrm_contribution_widget.color_main_bg',
361 'table_name' => 'civicrm_contribution_widget',
362 'entity' => 'Widget',
363 'bao' => 'CRM_Contribute_BAO_Widget',
368 'name' => 'color_bg',
369 'type' => CRM_Utils_Type
::T_STRING
,
370 'title' => ts('Other Background Color'),
372 'size' => CRM_Utils_Type
::TWELVE
,
373 'where' => 'civicrm_contribution_widget.color_bg',
374 'table_name' => 'civicrm_contribution_widget',
375 'entity' => 'Widget',
376 'bao' => 'CRM_Contribute_BAO_Widget',
380 'color_about_link' => [
381 'name' => 'color_about_link',
382 'type' => CRM_Utils_Type
::T_STRING
,
383 'title' => ts('About Link Color'),
385 'size' => CRM_Utils_Type
::TWELVE
,
386 'where' => 'civicrm_contribution_widget.color_about_link',
387 'table_name' => 'civicrm_contribution_widget',
388 'entity' => 'Widget',
389 'bao' => 'CRM_Contribute_BAO_Widget',
393 'color_homepage_link' => [
394 'name' => 'color_homepage_link',
395 'type' => CRM_Utils_Type
::T_STRING
,
396 'title' => ts('Homepage Link Color'),
398 'size' => CRM_Utils_Type
::TWELVE
,
399 'where' => 'civicrm_contribution_widget.color_homepage_link',
400 'table_name' => 'civicrm_contribution_widget',
401 'entity' => 'Widget',
402 'bao' => 'CRM_Contribute_BAO_Widget',
407 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
409 return Civi
::$statics[__CLASS__
]['fields'];
413 * Return a mapping from field-name to the corresponding key (as used in fields()).
416 * Array(string $name => string $uniqueName).
418 public static function &fieldKeys() {
419 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
420 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
422 return Civi
::$statics[__CLASS__
]['fieldKeys'];
426 * Returns the names of this table
430 public static function getTableName() {
431 return self
::$_tableName;
435 * Returns if this table needs to be logged
439 public function getLog() {
444 * Returns the list of fields that can be imported
446 * @param bool $prefix
450 public static function &import($prefix = FALSE) {
451 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution_widget', $prefix, []);
456 * Returns the list of fields that can be exported
458 * @param bool $prefix
462 public static function &export($prefix = FALSE) {
463 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution_widget', $prefix, []);
468 * Returns the list of indices
470 * @param bool $localize
474 public static function indices($localize = TRUE) {
476 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;