5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Contribute/Widget.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:b47ae223e6fd74db68394139a309be31)
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 static $_tableName = 'civicrm_contribution_widget';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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' => 'Contribution Id',
169 'table_name' => 'civicrm_contribution_widget',
170 'entity' => 'Widget',
171 'bao' => 'CRM_Contribute_BAO_Widget',
174 'contribution_page_id' => [
175 'name' => 'contribution_page_id',
176 'type' => CRM_Utils_Type
::T_INT
,
177 'title' => ts('Contribution Page'),
178 'description' => 'The Contribution Page which triggered this contribution',
179 'table_name' => 'civicrm_contribution_widget',
180 'entity' => 'Widget',
181 'bao' => 'CRM_Contribute_BAO_Widget',
183 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
186 'name' => 'is_active',
187 'type' => CRM_Utils_Type
::T_BOOLEAN
,
188 'title' => ts('Enabled?'),
189 'description' => 'Is this property active?',
190 'table_name' => 'civicrm_contribution_widget',
191 'entity' => 'Widget',
192 'bao' => 'CRM_Contribute_BAO_Widget',
197 'type' => CRM_Utils_Type
::T_STRING
,
198 'title' => ts('Widget Title'),
199 'description' => 'Widget title.',
201 'size' => CRM_Utils_Type
::HUGE
,
202 'table_name' => 'civicrm_contribution_widget',
203 'entity' => 'Widget',
204 'bao' => 'CRM_Contribute_BAO_Widget',
208 'name' => 'url_logo',
209 'type' => CRM_Utils_Type
::T_STRING
,
210 'title' => ts('Widget Image Url'),
211 'description' => 'URL to Widget logo',
213 'size' => CRM_Utils_Type
::HUGE
,
214 'table_name' => 'civicrm_contribution_widget',
215 'entity' => 'Widget',
216 'bao' => 'CRM_Contribute_BAO_Widget',
220 'name' => 'button_title',
221 'type' => CRM_Utils_Type
::T_STRING
,
222 'title' => ts('Button Title'),
223 'description' => 'Button title.',
225 'size' => CRM_Utils_Type
::HUGE
,
226 'table_name' => 'civicrm_contribution_widget',
227 'entity' => 'Widget',
228 'bao' => 'CRM_Contribute_BAO_Widget',
233 'type' => CRM_Utils_Type
::T_TEXT
,
234 'title' => ts('Description'),
235 'description' => 'About description.',
236 'table_name' => 'civicrm_contribution_widget',
237 'entity' => 'Widget',
238 'bao' => 'CRM_Contribute_BAO_Widget',
242 'name' => 'url_homepage',
243 'type' => CRM_Utils_Type
::T_STRING
,
244 'title' => ts('Homepage Url'),
245 'description' => 'URL to Homepage.',
247 'size' => CRM_Utils_Type
::HUGE
,
248 'table_name' => 'civicrm_contribution_widget',
249 'entity' => 'Widget',
250 'bao' => 'CRM_Contribute_BAO_Widget',
254 'name' => 'color_title',
255 'type' => CRM_Utils_Type
::T_STRING
,
256 'title' => ts('Title Color'),
258 'size' => CRM_Utils_Type
::TWELVE
,
259 'table_name' => 'civicrm_contribution_widget',
260 'entity' => 'Widget',
261 'bao' => 'CRM_Contribute_BAO_Widget',
265 'name' => 'color_button',
266 'type' => CRM_Utils_Type
::T_STRING
,
267 'title' => ts('Button Colour'),
269 'size' => CRM_Utils_Type
::TWELVE
,
270 'table_name' => 'civicrm_contribution_widget',
271 'entity' => 'Widget',
272 'bao' => 'CRM_Contribute_BAO_Widget',
276 'name' => 'color_bar',
277 'type' => CRM_Utils_Type
::T_STRING
,
278 'title' => ts('Bar Color'),
280 'size' => CRM_Utils_Type
::TWELVE
,
281 'table_name' => 'civicrm_contribution_widget',
282 'entity' => 'Widget',
283 'bao' => 'CRM_Contribute_BAO_Widget',
286 'color_main_text' => [
287 'name' => 'color_main_text',
288 'type' => CRM_Utils_Type
::T_STRING
,
289 'title' => ts('Main Text Color'),
291 'size' => CRM_Utils_Type
::TWELVE
,
292 'table_name' => 'civicrm_contribution_widget',
293 'entity' => 'Widget',
294 'bao' => 'CRM_Contribute_BAO_Widget',
298 'name' => 'color_main',
299 'type' => CRM_Utils_Type
::T_STRING
,
300 'title' => ts('Main Colour'),
302 'size' => CRM_Utils_Type
::TWELVE
,
303 'table_name' => 'civicrm_contribution_widget',
304 'entity' => 'Widget',
305 'bao' => 'CRM_Contribute_BAO_Widget',
309 'name' => 'color_main_bg',
310 'type' => CRM_Utils_Type
::T_STRING
,
311 'title' => ts('Backgroup Color'),
313 'size' => CRM_Utils_Type
::TWELVE
,
314 'table_name' => 'civicrm_contribution_widget',
315 'entity' => 'Widget',
316 'bao' => 'CRM_Contribute_BAO_Widget',
320 'name' => 'color_bg',
321 'type' => CRM_Utils_Type
::T_STRING
,
322 'title' => ts('Other Backgroun Colour'),
324 'size' => CRM_Utils_Type
::TWELVE
,
325 'table_name' => 'civicrm_contribution_widget',
326 'entity' => 'Widget',
327 'bao' => 'CRM_Contribute_BAO_Widget',
330 'color_about_link' => [
331 'name' => 'color_about_link',
332 'type' => CRM_Utils_Type
::T_STRING
,
333 'title' => ts('About Link Colour'),
335 'size' => CRM_Utils_Type
::TWELVE
,
336 'table_name' => 'civicrm_contribution_widget',
337 'entity' => 'Widget',
338 'bao' => 'CRM_Contribute_BAO_Widget',
341 'color_homepage_link' => [
342 'name' => 'color_homepage_link',
343 'type' => CRM_Utils_Type
::T_STRING
,
344 'title' => ts('Homepage Link Colour'),
346 'size' => CRM_Utils_Type
::TWELVE
,
347 'table_name' => 'civicrm_contribution_widget',
348 'entity' => 'Widget',
349 'bao' => 'CRM_Contribute_BAO_Widget',
353 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
355 return Civi
::$statics[__CLASS__
]['fields'];
359 * Return a mapping from field-name to the corresponding key (as used in fields()).
362 * Array(string $name => string $uniqueName).
364 public static function &fieldKeys() {
365 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
366 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
368 return Civi
::$statics[__CLASS__
]['fieldKeys'];
372 * Returns the names of this table
376 public static function getTableName() {
377 return self
::$_tableName;
381 * Returns if this table needs to be logged
385 public function getLog() {
390 * Returns the list of fields that can be imported
392 * @param bool $prefix
396 public static function &import($prefix = FALSE) {
397 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contribution_widget', $prefix, []);
402 * Returns the list of fields that can be exported
404 * @param bool $prefix
408 public static function &export($prefix = FALSE) {
409 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contribution_widget', $prefix, []);
414 * Returns the list of indices
416 * @param bool $localize
420 public static function indices($localize = TRUE) {
422 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;