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:b0e7180701d83e1d83d53bf2e43c0c51)
13 * Database access object for the Widget entity.
15 class CRM_Contribute_DAO_Widget
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_contribution_widget';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
39 * The Contribution Page which triggered this contribution
43 public $contribution_page_id;
46 * Is this property active?
105 public $color_main_text;
115 public $color_main_bg;
125 public $color_about_link;
130 public $color_homepage_link;
135 public function __construct() {
136 $this->__table
= 'civicrm_contribution_widget';
137 parent
::__construct();
141 * Returns localized title of this entity.
143 public static function getEntityTitle() {
144 return ts('Widgets');
148 * Returns foreign keys and entity references.
151 * [CRM_Core_Reference_Interface]
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']);
159 return Civi
::$statics[__CLASS__
]['links'];
163 * Returns all the column names of this table
167 public static function &fields() {
168 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
169 Civi
::$statics[__CLASS__
]['fields'] = [
172 'type' => CRM_Utils_Type
::T_INT
,
173 'title' => ts('Widget ID'),
174 'description' => ts('Contribution Id'),
176 'where' => 'civicrm_contribution_widget.id',
177 'table_name' => 'civicrm_contribution_widget',
178 'entity' => 'Widget',
179 'bao' => 'CRM_Contribute_BAO_Widget',
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',
193 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
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',
210 'type' => CRM_Utils_Type
::T_STRING
,
211 'title' => ts('Widget Title'),
212 'description' => ts('Widget title.'),
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',
223 'name' => 'url_logo',
224 'type' => CRM_Utils_Type
::T_STRING
,
225 'title' => ts('Widget Image Url'),
226 'description' => ts('URL to Widget logo'),
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',
237 'name' => 'button_title',
238 'type' => CRM_Utils_Type
::T_STRING
,
239 'title' => ts('Button Title'),
240 'description' => ts('Button title.'),
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',
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',
263 'name' => 'url_homepage',
264 'type' => CRM_Utils_Type
::T_STRING
,
265 'title' => ts('Homepage Url'),
266 'description' => ts('URL to Homepage.'),
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',
277 'name' => 'color_title',
278 'type' => CRM_Utils_Type
::T_STRING
,
279 'title' => ts('Title Color'),
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',
290 'name' => 'color_button',
291 'type' => CRM_Utils_Type
::T_STRING
,
292 'title' => ts('Button Color'),
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',
303 'name' => 'color_bar',
304 'type' => CRM_Utils_Type
::T_STRING
,
305 'title' => ts('Bar Color'),
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',
315 'color_main_text' => [
316 'name' => 'color_main_text',
317 'type' => CRM_Utils_Type
::T_STRING
,
318 'title' => ts('Main Text Color'),
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',
329 'name' => 'color_main',
330 'type' => CRM_Utils_Type
::T_STRING
,
331 'title' => ts('Main Color'),
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',
342 'name' => 'color_main_bg',
343 'type' => CRM_Utils_Type
::T_STRING
,
344 'title' => ts('Background Color'),
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',
355 'name' => 'color_bg',
356 'type' => CRM_Utils_Type
::T_STRING
,
357 'title' => ts('Other Background Color'),
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',
367 'color_about_link' => [
368 'name' => 'color_about_link',
369 'type' => CRM_Utils_Type
::T_STRING
,
370 'title' => ts('About Link Color'),
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',
380 'color_homepage_link' => [
381 'name' => 'color_homepage_link',
382 'type' => CRM_Utils_Type
::T_STRING
,
383 'title' => ts('Homepage Link Color'),
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',
394 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
396 return Civi
::$statics[__CLASS__
]['fields'];
400 * Return a mapping from field-name to the corresponding key (as used in fields()).
403 * Array(string $name => string $uniqueName).
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()));
409 return Civi
::$statics[__CLASS__
]['fieldKeys'];
413 * Returns the names of this table
417 public static function getTableName() {
418 return self
::$_tableName;
422 * Returns if this table needs to be logged
426 public function getLog() {
431 * Returns the list of fields that can be imported
433 * @param bool $prefix
437 public static function &import($prefix = FALSE) {
438 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution_widget', $prefix, []);
443 * Returns the list of fields that can be exported
445 * @param bool $prefix
449 public static function &export($prefix = FALSE) {
450 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution_widget', $prefix, []);
455 * Returns the list of indices
457 * @param bool $localize
461 public static function indices($localize = TRUE) {
463 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;