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/Premium.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:c84ce7b79339fc7842fe872fe75eccc1)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Contribute_DAO_Premium
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_premiums';
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 value to see if we should log any modifications to
64 * this table in the civicrm_log table
75 * Joins these premium settings to another object. Always civicrm_contribution_page for now.
86 * Is the Premiums feature enabled for this page?
90 public $premiums_active;
92 * Title for Premiums section.
96 public $premiums_intro_title;
98 * Displayed in <div> at top of Premiums section of page. Text and HTML allowed.
102 public $premiums_intro_text;
104 * This email address is included in receipts if it is populated and a premium has been selected.
108 public $premiums_contact_email;
110 * This phone number is included in receipts if it is populated and a premium has been selected.
114 public $premiums_contact_phone;
116 * Boolean. Should we automatically display minimum contribution amount text after the premium descriptions.
120 public $premiums_display_min_contribution;
122 * Label displayed for No Thank-you option in premiums block (e.g. No thank you)
126 public $premiums_nothankyou_label;
131 public $premiums_nothankyou_position;
135 * @return civicrm_premiums
137 function __construct() {
138 $this->__table
= 'civicrm_premiums';
139 parent
::__construct();
142 * Returns foreign keys and entity references
145 * [CRM_Core_Reference_Interface]
147 static function getReferenceColumns() {
148 if (!self
::$_links) {
149 self
::$_links = static ::createReferenceColumns(__CLASS__
);
150 self
::$_links[] = new CRM_Core_Reference_Dynamic(self
::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
152 return self
::$_links;
155 * Returns all the column names of this table
159 static function &fields() {
160 if (!(self
::$_fields)) {
161 self
::$_fields = array(
164 'type' => CRM_Utils_Type
::T_INT
,
165 'title' => ts('Premium ID') ,
168 'entity_table' => array(
169 'name' => 'entity_table',
170 'type' => CRM_Utils_Type
::T_STRING
,
171 'title' => ts('Premium Entity') ,
172 'description' => 'Joins these premium settings to another object. Always civicrm_contribution_page for now.',
175 'size' => CRM_Utils_Type
::BIG
,
177 'entity_id' => array(
178 'name' => 'entity_id',
179 'type' => CRM_Utils_Type
::T_INT
,
180 'title' => ts('Premium entity ID') ,
183 'premiums_active' => array(
184 'name' => 'premiums_active',
185 'type' => CRM_Utils_Type
::T_BOOLEAN
,
186 'title' => ts('Is Premium Active?') ,
187 'description' => 'Is the Premiums feature enabled for this page?',
190 'premiums_intro_title' => array(
191 'name' => 'premiums_intro_title',
192 'type' => CRM_Utils_Type
::T_STRING
,
193 'title' => ts('Title for Premiums section') ,
194 'description' => 'Title for Premiums section.',
196 'size' => CRM_Utils_Type
::HUGE
,
198 'premiums_intro_text' => array(
199 'name' => 'premiums_intro_text',
200 'type' => CRM_Utils_Type
::T_TEXT
,
201 'title' => ts('Premium Introductory Text') ,
202 'description' => 'Displayed in <div> at top of Premiums section of page. Text and HTML allowed.',
204 'premiums_contact_email' => array(
205 'name' => 'premiums_contact_email',
206 'type' => CRM_Utils_Type
::T_STRING
,
207 'title' => ts('Premium Contact Email') ,
208 'description' => 'This email address is included in receipts if it is populated and a premium has been selected.',
210 'size' => CRM_Utils_Type
::HUGE
,
212 'premiums_contact_phone' => array(
213 'name' => 'premiums_contact_phone',
214 'type' => CRM_Utils_Type
::T_STRING
,
215 'title' => ts('Premiums Contact Phone') ,
216 'description' => 'This phone number is included in receipts if it is populated and a premium has been selected.',
218 'size' => CRM_Utils_Type
::BIG
,
220 'premiums_display_min_contribution' => array(
221 'name' => 'premiums_display_min_contribution',
222 'type' => CRM_Utils_Type
::T_BOOLEAN
,
223 'title' => ts('Display Minimum Contribution?') ,
224 'description' => 'Boolean. Should we automatically display minimum contribution amount text after the premium descriptions.',
227 'premiums_nothankyou_label' => array(
228 'name' => 'premiums_nothankyou_label',
229 'type' => CRM_Utils_Type
::T_STRING
,
230 'title' => ts('No Thank-you Text') ,
231 'description' => 'Label displayed for No Thank-you option in premiums block (e.g. No thank you)',
233 'size' => CRM_Utils_Type
::HUGE
,
235 'premiums_nothankyou_position' => array(
236 'name' => 'premiums_nothankyou_position',
237 'type' => CRM_Utils_Type
::T_INT
,
238 'title' => ts('No Thank-you Position') ,
243 return self
::$_fields;
246 * Returns an array containing, for each field, the arary key used for that
247 * field in self::$_fields.
251 static function &fieldKeys() {
252 if (!(self
::$_fieldKeys)) {
253 self
::$_fieldKeys = array(
255 'entity_table' => 'entity_table',
256 'entity_id' => 'entity_id',
257 'premiums_active' => 'premiums_active',
258 'premiums_intro_title' => 'premiums_intro_title',
259 'premiums_intro_text' => 'premiums_intro_text',
260 'premiums_contact_email' => 'premiums_contact_email',
261 'premiums_contact_phone' => 'premiums_contact_phone',
262 'premiums_display_min_contribution' => 'premiums_display_min_contribution',
263 'premiums_nothankyou_label' => 'premiums_nothankyou_label',
264 'premiums_nothankyou_position' => 'premiums_nothankyou_position',
267 return self
::$_fieldKeys;
270 * Returns the names of this table
274 static function getTableName() {
275 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
278 * Returns if this table needs to be logged
286 * Returns the list of fields that can be imported
288 * @param bool $prefix
292 static function &import($prefix = false) {
293 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'premiums', $prefix, array());
297 * Returns the list of fields that can be exported
299 * @param bool $prefix
303 static function &export($prefix = false) {
304 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'premiums', $prefix, array());