3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
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-2017
31 * Generated from xml/schema/CRM/Contribute/Premium.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:86a5118380bd35cee851da735f699ac2)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Contribute_DAO_Premium constructor.
40 class CRM_Contribute_DAO_Premium
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_premiums';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
59 * Joins these premium settings to another object. Always civicrm_contribution_page for now.
70 * Is the Premiums feature enabled for this page?
74 public $premiums_active;
76 * Title for Premiums section.
80 public $premiums_intro_title;
82 * Displayed in <div> at top of Premiums section of page. Text and HTML allowed.
86 public $premiums_intro_text;
88 * This email address is included in receipts if it is populated and a premium has been selected.
92 public $premiums_contact_email;
94 * This phone number is included in receipts if it is populated and a premium has been selected.
98 public $premiums_contact_phone;
100 * Boolean. Should we automatically display minimum contribution amount text after the premium descriptions.
104 public $premiums_display_min_contribution;
106 * Label displayed for No Thank-you option in premiums block (e.g. No thank you)
110 public $premiums_nothankyou_label;
115 public $premiums_nothankyou_position;
119 function __construct() {
120 $this->__table
= 'civicrm_premiums';
121 parent
::__construct();
124 * Returns foreign keys and entity references.
127 * [CRM_Core_Reference_Interface]
129 static function getReferenceColumns() {
130 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
131 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
132 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
133 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
135 return Civi
::$statics[__CLASS__
]['links'];
138 * Returns all the column names of this table
142 static function &fields() {
143 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
144 Civi
::$statics[__CLASS__
]['fields'] = array(
147 'type' => CRM_Utils_Type
::T_INT
,
148 'title' => ts('Premium ID') ,
150 'table_name' => 'civicrm_premiums',
151 'entity' => 'Premium',
152 'bao' => 'CRM_Contribute_BAO_Premium',
155 'entity_table' => array(
156 'name' => 'entity_table',
157 'type' => CRM_Utils_Type
::T_STRING
,
158 'title' => ts('Premium Entity') ,
159 'description' => 'Joins these premium settings to another object. Always civicrm_contribution_page for now.',
162 'size' => CRM_Utils_Type
::BIG
,
163 'table_name' => 'civicrm_premiums',
164 'entity' => 'Premium',
165 'bao' => 'CRM_Contribute_BAO_Premium',
168 'entity_id' => array(
169 'name' => 'entity_id',
170 'type' => CRM_Utils_Type
::T_INT
,
171 'title' => ts('Premium entity ID') ,
173 'table_name' => 'civicrm_premiums',
174 'entity' => 'Premium',
175 'bao' => 'CRM_Contribute_BAO_Premium',
178 'premiums_active' => array(
179 'name' => 'premiums_active',
180 'type' => CRM_Utils_Type
::T_BOOLEAN
,
181 'title' => ts('Is Premium Active?') ,
182 'description' => 'Is the Premiums feature enabled for this page?',
184 'table_name' => 'civicrm_premiums',
185 'entity' => 'Premium',
186 'bao' => 'CRM_Contribute_BAO_Premium',
189 'premiums_intro_title' => array(
190 'name' => 'premiums_intro_title',
191 'type' => CRM_Utils_Type
::T_STRING
,
192 'title' => ts('Title for Premiums section') ,
193 'description' => 'Title for Premiums section.',
195 'size' => CRM_Utils_Type
::HUGE
,
196 'table_name' => 'civicrm_premiums',
197 'entity' => 'Premium',
198 'bao' => 'CRM_Contribute_BAO_Premium',
201 'premiums_intro_text' => array(
202 'name' => 'premiums_intro_text',
203 'type' => CRM_Utils_Type
::T_TEXT
,
204 'title' => ts('Premium Introductory Text') ,
205 'description' => 'Displayed in <div> at top of Premiums section of page. Text and HTML allowed.',
206 'table_name' => 'civicrm_premiums',
207 'entity' => 'Premium',
208 'bao' => 'CRM_Contribute_BAO_Premium',
211 'premiums_contact_email' => array(
212 'name' => 'premiums_contact_email',
213 'type' => CRM_Utils_Type
::T_STRING
,
214 'title' => ts('Premium Contact Email') ,
215 'description' => 'This email address is included in receipts if it is populated and a premium has been selected.',
217 'size' => CRM_Utils_Type
::HUGE
,
218 'table_name' => 'civicrm_premiums',
219 'entity' => 'Premium',
220 'bao' => 'CRM_Contribute_BAO_Premium',
223 'premiums_contact_phone' => array(
224 'name' => 'premiums_contact_phone',
225 'type' => CRM_Utils_Type
::T_STRING
,
226 'title' => ts('Premiums Contact Phone') ,
227 'description' => 'This phone number is included in receipts if it is populated and a premium has been selected.',
229 'size' => CRM_Utils_Type
::BIG
,
230 'table_name' => 'civicrm_premiums',
231 'entity' => 'Premium',
232 'bao' => 'CRM_Contribute_BAO_Premium',
235 'premiums_display_min_contribution' => array(
236 'name' => 'premiums_display_min_contribution',
237 'type' => CRM_Utils_Type
::T_BOOLEAN
,
238 'title' => ts('Display Minimum Contribution?') ,
239 'description' => 'Boolean. Should we automatically display minimum contribution amount text after the premium descriptions.',
241 'table_name' => 'civicrm_premiums',
242 'entity' => 'Premium',
243 'bao' => 'CRM_Contribute_BAO_Premium',
246 'premiums_nothankyou_label' => array(
247 'name' => 'premiums_nothankyou_label',
248 'type' => CRM_Utils_Type
::T_STRING
,
249 'title' => ts('No Thank-you Text') ,
250 'description' => 'Label displayed for No Thank-you option in premiums block (e.g. No thank you)',
252 'size' => CRM_Utils_Type
::HUGE
,
253 'table_name' => 'civicrm_premiums',
254 'entity' => 'Premium',
255 'bao' => 'CRM_Contribute_BAO_Premium',
258 'premiums_nothankyou_position' => array(
259 'name' => 'premiums_nothankyou_position',
260 'type' => CRM_Utils_Type
::T_INT
,
261 'title' => ts('No Thank-you Position') ,
263 'table_name' => 'civicrm_premiums',
264 'entity' => 'Premium',
265 'bao' => 'CRM_Contribute_BAO_Premium',
269 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
271 return Civi
::$statics[__CLASS__
]['fields'];
274 * Return a mapping from field-name to the corresponding key (as used in fields()).
277 * Array(string $name => string $uniqueName).
279 static function &fieldKeys() {
280 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
281 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
283 return Civi
::$statics[__CLASS__
]['fieldKeys'];
286 * Returns the names of this table
290 static function getTableName() {
291 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
294 * Returns if this table needs to be logged
302 * Returns the list of fields that can be imported
304 * @param bool $prefix
308 static function &import($prefix = false) {
309 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'premiums', $prefix, array());
313 * Returns the list of fields that can be exported
315 * @param bool $prefix
319 static function &export($prefix = false) {
320 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'premiums', $prefix, array());