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:a1f9bf066d659e32e32cd324aeb7a286)
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 foreign keys and entity references.
144 * [CRM_Core_Reference_Interface]
146 public static function getReferenceColumns() {
147 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
148 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
149 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'contribution_page_id', 'civicrm_contribution_page', 'id');
150 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
152 return Civi
::$statics[__CLASS__
]['links'];
156 * Returns all the column names of this table
160 public static function &fields() {
161 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
162 Civi
::$statics[__CLASS__
]['fields'] = [
165 'type' => CRM_Utils_Type
::T_INT
,
166 'title' => ts('Widget ID'),
167 'description' => ts('Contribution Id'),
169 'where' => 'civicrm_contribution_widget.id',
170 'table_name' => 'civicrm_contribution_widget',
171 'entity' => 'Widget',
172 'bao' => 'CRM_Contribute_BAO_Widget',
175 'contribution_page_id' => [
176 'name' => 'contribution_page_id',
177 'type' => CRM_Utils_Type
::T_INT
,
178 'title' => ts('Contribution Page'),
179 'description' => ts('The Contribution Page which triggered this contribution'),
180 'where' => 'civicrm_contribution_widget.contribution_page_id',
181 'table_name' => 'civicrm_contribution_widget',
182 'entity' => 'Widget',
183 'bao' => 'CRM_Contribute_BAO_Widget',
185 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
188 'name' => 'is_active',
189 'type' => CRM_Utils_Type
::T_BOOLEAN
,
190 'title' => ts('Enabled?'),
191 'description' => ts('Is this property active?'),
192 'where' => 'civicrm_contribution_widget.is_active',
193 'table_name' => 'civicrm_contribution_widget',
194 'entity' => 'Widget',
195 'bao' => 'CRM_Contribute_BAO_Widget',
200 'type' => CRM_Utils_Type
::T_STRING
,
201 'title' => ts('Widget Title'),
202 'description' => ts('Widget title.'),
204 'size' => CRM_Utils_Type
::HUGE
,
205 'where' => 'civicrm_contribution_widget.title',
206 'table_name' => 'civicrm_contribution_widget',
207 'entity' => 'Widget',
208 'bao' => 'CRM_Contribute_BAO_Widget',
212 'name' => 'url_logo',
213 'type' => CRM_Utils_Type
::T_STRING
,
214 'title' => ts('Widget Image Url'),
215 'description' => ts('URL to Widget logo'),
217 'size' => CRM_Utils_Type
::HUGE
,
218 'where' => 'civicrm_contribution_widget.url_logo',
219 'table_name' => 'civicrm_contribution_widget',
220 'entity' => 'Widget',
221 'bao' => 'CRM_Contribute_BAO_Widget',
225 'name' => 'button_title',
226 'type' => CRM_Utils_Type
::T_STRING
,
227 'title' => ts('Button Title'),
228 'description' => ts('Button title.'),
230 'size' => CRM_Utils_Type
::HUGE
,
231 'where' => 'civicrm_contribution_widget.button_title',
232 'table_name' => 'civicrm_contribution_widget',
233 'entity' => 'Widget',
234 'bao' => 'CRM_Contribute_BAO_Widget',
239 'type' => CRM_Utils_Type
::T_TEXT
,
240 'title' => ts('Description'),
241 'description' => ts('About description.'),
242 'where' => 'civicrm_contribution_widget.about',
243 'table_name' => 'civicrm_contribution_widget',
244 'entity' => 'Widget',
245 'bao' => 'CRM_Contribute_BAO_Widget',
249 'name' => 'url_homepage',
250 'type' => CRM_Utils_Type
::T_STRING
,
251 'title' => ts('Homepage Url'),
252 'description' => ts('URL to Homepage.'),
254 'size' => CRM_Utils_Type
::HUGE
,
255 'where' => 'civicrm_contribution_widget.url_homepage',
256 'table_name' => 'civicrm_contribution_widget',
257 'entity' => 'Widget',
258 'bao' => 'CRM_Contribute_BAO_Widget',
262 'name' => 'color_title',
263 'type' => CRM_Utils_Type
::T_STRING
,
264 'title' => ts('Title Color'),
266 'size' => CRM_Utils_Type
::TWELVE
,
267 'where' => 'civicrm_contribution_widget.color_title',
268 'table_name' => 'civicrm_contribution_widget',
269 'entity' => 'Widget',
270 'bao' => 'CRM_Contribute_BAO_Widget',
274 'name' => 'color_button',
275 'type' => CRM_Utils_Type
::T_STRING
,
276 'title' => ts('Button Colour'),
278 'size' => CRM_Utils_Type
::TWELVE
,
279 'where' => 'civicrm_contribution_widget.color_button',
280 'table_name' => 'civicrm_contribution_widget',
281 'entity' => 'Widget',
282 'bao' => 'CRM_Contribute_BAO_Widget',
286 'name' => 'color_bar',
287 'type' => CRM_Utils_Type
::T_STRING
,
288 'title' => ts('Bar Color'),
290 'size' => CRM_Utils_Type
::TWELVE
,
291 'where' => 'civicrm_contribution_widget.color_bar',
292 'table_name' => 'civicrm_contribution_widget',
293 'entity' => 'Widget',
294 'bao' => 'CRM_Contribute_BAO_Widget',
297 'color_main_text' => [
298 'name' => 'color_main_text',
299 'type' => CRM_Utils_Type
::T_STRING
,
300 'title' => ts('Main Text Color'),
302 'size' => CRM_Utils_Type
::TWELVE
,
303 'where' => 'civicrm_contribution_widget.color_main_text',
304 'table_name' => 'civicrm_contribution_widget',
305 'entity' => 'Widget',
306 'bao' => 'CRM_Contribute_BAO_Widget',
310 'name' => 'color_main',
311 'type' => CRM_Utils_Type
::T_STRING
,
312 'title' => ts('Main Colour'),
314 'size' => CRM_Utils_Type
::TWELVE
,
315 'where' => 'civicrm_contribution_widget.color_main',
316 'table_name' => 'civicrm_contribution_widget',
317 'entity' => 'Widget',
318 'bao' => 'CRM_Contribute_BAO_Widget',
322 'name' => 'color_main_bg',
323 'type' => CRM_Utils_Type
::T_STRING
,
324 'title' => ts('Backgroup Color'),
326 'size' => CRM_Utils_Type
::TWELVE
,
327 'where' => 'civicrm_contribution_widget.color_main_bg',
328 'table_name' => 'civicrm_contribution_widget',
329 'entity' => 'Widget',
330 'bao' => 'CRM_Contribute_BAO_Widget',
334 'name' => 'color_bg',
335 'type' => CRM_Utils_Type
::T_STRING
,
336 'title' => ts('Other Backgroun Colour'),
338 'size' => CRM_Utils_Type
::TWELVE
,
339 'where' => 'civicrm_contribution_widget.color_bg',
340 'table_name' => 'civicrm_contribution_widget',
341 'entity' => 'Widget',
342 'bao' => 'CRM_Contribute_BAO_Widget',
345 'color_about_link' => [
346 'name' => 'color_about_link',
347 'type' => CRM_Utils_Type
::T_STRING
,
348 'title' => ts('About Link Colour'),
350 'size' => CRM_Utils_Type
::TWELVE
,
351 'where' => 'civicrm_contribution_widget.color_about_link',
352 'table_name' => 'civicrm_contribution_widget',
353 'entity' => 'Widget',
354 'bao' => 'CRM_Contribute_BAO_Widget',
357 'color_homepage_link' => [
358 'name' => 'color_homepage_link',
359 'type' => CRM_Utils_Type
::T_STRING
,
360 'title' => ts('Homepage Link Colour'),
362 'size' => CRM_Utils_Type
::TWELVE
,
363 'where' => 'civicrm_contribution_widget.color_homepage_link',
364 'table_name' => 'civicrm_contribution_widget',
365 'entity' => 'Widget',
366 'bao' => 'CRM_Contribute_BAO_Widget',
370 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
372 return Civi
::$statics[__CLASS__
]['fields'];
376 * Return a mapping from field-name to the corresponding key (as used in fields()).
379 * Array(string $name => string $uniqueName).
381 public static function &fieldKeys() {
382 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
383 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
385 return Civi
::$statics[__CLASS__
]['fieldKeys'];
389 * Returns the names of this table
393 public static function getTableName() {
394 return self
::$_tableName;
398 * Returns if this table needs to be logged
402 public function getLog() {
407 * Returns the list of fields that can be imported
409 * @param bool $prefix
413 public static function &import($prefix = FALSE) {
414 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution_widget', $prefix, []);
419 * Returns the list of fields that can be exported
421 * @param bool $prefix
425 public static function &export($prefix = FALSE) {
426 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution_widget', $prefix, []);
431 * Returns the list of indices
433 * @param bool $localize
437 public static function indices($localize = TRUE) {
439 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;