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 FK relationships
55 static $_links = null;
57 * static value to see if we should log any modifications to
58 * this table in the civicrm_log table
69 * Joins these premium settings to another object. Always civicrm_contribution_page for now.
80 * Is the Premiums feature enabled for this page?
84 public $premiums_active;
86 * Title for Premiums section.
90 public $premiums_intro_title;
92 * Displayed in <div> at top of Premiums section of page. Text and HTML allowed.
96 public $premiums_intro_text;
98 * This email address is included in receipts if it is populated and a premium has been selected.
102 public $premiums_contact_email;
104 * This phone number is included in receipts if it is populated and a premium has been selected.
108 public $premiums_contact_phone;
110 * Boolean. Should we automatically display minimum contribution amount text after the premium descriptions.
114 public $premiums_display_min_contribution;
116 * Label displayed for No Thank-you option in premiums block (e.g. No thank you)
120 public $premiums_nothankyou_label;
125 public $premiums_nothankyou_position;
129 * @return civicrm_premiums
131 function __construct() {
132 $this->__table
= 'civicrm_premiums';
133 parent
::__construct();
136 * Returns foreign keys and entity references
139 * [CRM_Core_Reference_Interface]
141 static function getReferenceColumns() {
142 if (!self
::$_links) {
143 self
::$_links = static ::createReferenceColumns(__CLASS__
);
144 self
::$_links[] = new CRM_Core_Reference_Dynamic(self
::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
146 return self
::$_links;
149 * Returns all the column names of this table
153 static function &fields() {
154 if (!(self
::$_fields)) {
155 self
::$_fields = array(
158 'type' => CRM_Utils_Type
::T_INT
,
159 'title' => ts('Premium ID') ,
162 'entity_table' => array(
163 'name' => 'entity_table',
164 'type' => CRM_Utils_Type
::T_STRING
,
165 'title' => ts('Premium Entity') ,
166 'description' => 'Joins these premium settings to another object. Always civicrm_contribution_page for now.',
169 'size' => CRM_Utils_Type
::BIG
,
171 'entity_id' => array(
172 'name' => 'entity_id',
173 'type' => CRM_Utils_Type
::T_INT
,
174 'title' => ts('Premium entity ID') ,
177 'premiums_active' => array(
178 'name' => 'premiums_active',
179 'type' => CRM_Utils_Type
::T_BOOLEAN
,
180 'title' => ts('Is Premium Active?') ,
181 'description' => 'Is the Premiums feature enabled for this page?',
184 'premiums_intro_title' => array(
185 'name' => 'premiums_intro_title',
186 'type' => CRM_Utils_Type
::T_STRING
,
187 'title' => ts('Title for Premiums section') ,
188 'description' => 'Title for Premiums section.',
190 'size' => CRM_Utils_Type
::HUGE
,
192 'premiums_intro_text' => array(
193 'name' => 'premiums_intro_text',
194 'type' => CRM_Utils_Type
::T_TEXT
,
195 'title' => ts('Premium Introductory Text') ,
196 'description' => 'Displayed in <div> at top of Premiums section of page. Text and HTML allowed.',
198 'premiums_contact_email' => array(
199 'name' => 'premiums_contact_email',
200 'type' => CRM_Utils_Type
::T_STRING
,
201 'title' => ts('Premium Contact Email') ,
202 'description' => 'This email address is included in receipts if it is populated and a premium has been selected.',
204 'size' => CRM_Utils_Type
::HUGE
,
206 'premiums_contact_phone' => array(
207 'name' => 'premiums_contact_phone',
208 'type' => CRM_Utils_Type
::T_STRING
,
209 'title' => ts('Premiums Contact Phone') ,
210 'description' => 'This phone number is included in receipts if it is populated and a premium has been selected.',
212 'size' => CRM_Utils_Type
::BIG
,
214 'premiums_display_min_contribution' => array(
215 'name' => 'premiums_display_min_contribution',
216 'type' => CRM_Utils_Type
::T_BOOLEAN
,
217 'title' => ts('Display Minimum Contribution?') ,
218 'description' => 'Boolean. Should we automatically display minimum contribution amount text after the premium descriptions.',
221 'premiums_nothankyou_label' => array(
222 'name' => 'premiums_nothankyou_label',
223 'type' => CRM_Utils_Type
::T_STRING
,
224 'title' => ts('No Thank-you Text') ,
225 'description' => 'Label displayed for No Thank-you option in premiums block (e.g. No thank you)',
227 'size' => CRM_Utils_Type
::HUGE
,
229 'premiums_nothankyou_position' => array(
230 'name' => 'premiums_nothankyou_position',
231 'type' => CRM_Utils_Type
::T_INT
,
232 'title' => ts('No Thank-you Position') ,
237 return self
::$_fields;
240 * Return a mapping from field-name to the corresponding key (as used in fields()).
243 * Array(string $name => string $uniqueName).
245 static function &fieldKeys() {
246 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
247 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
249 return Civi
::$statics[__CLASS__
]['fieldKeys'];
252 * Returns the names of this table
256 static function getTableName() {
257 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
260 * Returns if this table needs to be logged
268 * Returns the list of fields that can be imported
270 * @param bool $prefix
274 static function &import($prefix = false) {
275 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'premiums', $prefix, array());
279 * Returns the list of fields that can be exported
281 * @param bool $prefix
285 static function &export($prefix = false) {
286 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'premiums', $prefix, array());