3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2016
31 * Generated from xml/schema/CRM/Contribute/Widget.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:7414818b41b32e4c0d5a919be3f5f1e5)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Contribute_DAO_Widget
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_contribution_widget';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the keys used in $_fields for each field.
55 static $_fieldKeys = null;
57 * static instance to hold the FK relationships
61 static $_links = null;
63 * static instance to hold the values that can
68 static $_import = null;
70 * static instance to hold the values that can
75 static $_export = null;
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
90 * The Contribution Page which triggered this contribution
94 public $contribution_page_id;
96 * Is this property active?
118 public $button_title;
130 public $url_homepage;
140 public $color_button;
150 public $color_main_text;
160 public $color_main_bg;
170 public $color_about_link;
175 public $color_homepage_link;
179 * @return civicrm_contribution_widget
181 function __construct() {
182 $this->__table
= 'civicrm_contribution_widget';
183 parent
::__construct();
186 * Returns foreign keys and entity references
189 * [CRM_Core_Reference_Interface]
191 static function getReferenceColumns() {
192 if (!self
::$_links) {
193 self
::$_links = static ::createReferenceColumns(__CLASS__
);
194 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'contribution_page_id', 'civicrm_contribution_page', 'id');
196 return self
::$_links;
199 * Returns all the column names of this table
203 static function &fields() {
204 if (!(self
::$_fields)) {
205 self
::$_fields = array(
208 'type' => CRM_Utils_Type
::T_INT
,
209 'title' => ts('Widget ID') ,
210 'description' => 'Contribution Id',
213 'contribution_page_id' => array(
214 'name' => 'contribution_page_id',
215 'type' => CRM_Utils_Type
::T_INT
,
216 'title' => ts('Contribution Page') ,
217 'description' => 'The Contribution Page which triggered this contribution',
218 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
220 'is_active' => array(
221 'name' => 'is_active',
222 'type' => CRM_Utils_Type
::T_BOOLEAN
,
223 'title' => ts('Enabled?') ,
224 'description' => 'Is this property active?',
228 'type' => CRM_Utils_Type
::T_STRING
,
229 'title' => ts('Widget Title') ,
230 'description' => 'Widget title.',
232 'size' => CRM_Utils_Type
::HUGE
,
235 'name' => 'url_logo',
236 'type' => CRM_Utils_Type
::T_STRING
,
237 'title' => ts('Widget Image Url') ,
238 'description' => 'URL to Widget logo',
240 'size' => CRM_Utils_Type
::HUGE
,
242 'button_title' => array(
243 'name' => 'button_title',
244 'type' => CRM_Utils_Type
::T_STRING
,
245 'title' => ts('Button Title') ,
246 'description' => 'Button title.',
248 'size' => CRM_Utils_Type
::HUGE
,
252 'type' => CRM_Utils_Type
::T_TEXT
,
253 'title' => ts('Description') ,
254 'description' => 'About description.',
256 'url_homepage' => array(
257 'name' => 'url_homepage',
258 'type' => CRM_Utils_Type
::T_STRING
,
259 'title' => ts('Homepage Url') ,
260 'description' => 'URL to Homepage.',
262 'size' => CRM_Utils_Type
::HUGE
,
264 'color_title' => array(
265 'name' => 'color_title',
266 'type' => CRM_Utils_Type
::T_STRING
,
267 'title' => ts('Title Color') ,
269 'size' => CRM_Utils_Type
::TWELVE
,
271 'color_button' => array(
272 'name' => 'color_button',
273 'type' => CRM_Utils_Type
::T_STRING
,
274 'title' => ts('Button Colour') ,
276 'size' => CRM_Utils_Type
::TWELVE
,
278 'color_bar' => array(
279 'name' => 'color_bar',
280 'type' => CRM_Utils_Type
::T_STRING
,
281 'title' => ts('Bar Color') ,
283 'size' => CRM_Utils_Type
::TWELVE
,
285 'color_main_text' => array(
286 'name' => 'color_main_text',
287 'type' => CRM_Utils_Type
::T_STRING
,
288 'title' => ts('Main Text Color') ,
290 'size' => CRM_Utils_Type
::TWELVE
,
292 'color_main' => array(
293 'name' => 'color_main',
294 'type' => CRM_Utils_Type
::T_STRING
,
295 'title' => ts('Main Colour') ,
297 'size' => CRM_Utils_Type
::TWELVE
,
299 'color_main_bg' => array(
300 'name' => 'color_main_bg',
301 'type' => CRM_Utils_Type
::T_STRING
,
302 'title' => ts('Backgroup Color') ,
304 'size' => CRM_Utils_Type
::TWELVE
,
307 'name' => 'color_bg',
308 'type' => CRM_Utils_Type
::T_STRING
,
309 'title' => ts('Other Backgroun Colour') ,
311 'size' => CRM_Utils_Type
::TWELVE
,
313 'color_about_link' => array(
314 'name' => 'color_about_link',
315 'type' => CRM_Utils_Type
::T_STRING
,
316 'title' => ts('About Link Colour') ,
318 'size' => CRM_Utils_Type
::TWELVE
,
320 'color_homepage_link' => array(
321 'name' => 'color_homepage_link',
322 'type' => CRM_Utils_Type
::T_STRING
,
323 'title' => ts('Homepage Link Colour') ,
325 'size' => CRM_Utils_Type
::TWELVE
,
329 return self
::$_fields;
332 * Returns an array containing, for each field, the arary key used for that
333 * field in self::$_fields.
337 static function &fieldKeys() {
338 if (!(self
::$_fieldKeys)) {
339 self
::$_fieldKeys = array(
341 'contribution_page_id' => 'contribution_page_id',
342 'is_active' => 'is_active',
344 'url_logo' => 'url_logo',
345 'button_title' => 'button_title',
347 'url_homepage' => 'url_homepage',
348 'color_title' => 'color_title',
349 'color_button' => 'color_button',
350 'color_bar' => 'color_bar',
351 'color_main_text' => 'color_main_text',
352 'color_main' => 'color_main',
353 'color_main_bg' => 'color_main_bg',
354 'color_bg' => 'color_bg',
355 'color_about_link' => 'color_about_link',
356 'color_homepage_link' => 'color_homepage_link',
359 return self
::$_fieldKeys;
362 * Returns the names of this table
366 static function getTableName() {
367 return self
::$_tableName;
370 * Returns if this table needs to be logged
378 * Returns the list of fields that can be imported
380 * @param bool $prefix
384 static function &import($prefix = false) {
385 if (!(self
::$_import)) {
386 self
::$_import = array();
387 $fields = self
::fields();
388 foreach($fields as $name => $field) {
389 if (CRM_Utils_Array
::value('import', $field)) {
391 self
::$_import['contribution_widget'] = & $fields[$name];
393 self
::$_import[$name] = & $fields[$name];
398 return self
::$_import;
401 * Returns the list of fields that can be exported
403 * @param bool $prefix
407 static function &export($prefix = false) {
408 if (!(self
::$_export)) {
409 self
::$_export = array();
410 $fields = self
::fields();
411 foreach($fields as $name => $field) {
412 if (CRM_Utils_Array
::value('export', $field)) {
414 self
::$_export['contribution_widget'] = & $fields[$name];
416 self
::$_export[$name] = & $fields[$name];
421 return self
::$_export;