Regen DAOs with new import() / export()
[civicrm-core.git] / CRM / Member / DAO / MembershipBlock.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2016
30 *
31 * Generated from xml/schema/CRM/Member/MembershipBlock.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:23f10318bfaa3e50862d8ad8853ce662)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Member_DAO_MembershipBlock extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_membership_block';
44 /**
45 * static instance to hold the field values
46 *
47 * @var array
48 */
49 static $_fields = null;
50 /**
51 * static instance to hold the keys used in $_fields for each field.
52 *
53 * @var array
54 */
55 static $_fieldKeys = null;
56 /**
57 * static instance to hold the FK relationships
58 *
59 * @var string
60 */
61 static $_links = null;
62 /**
63 * static value to see if we should log any modifications to
64 * this table in the civicrm_log table
65 *
66 * @var boolean
67 */
68 static $_log = true;
69 /**
70 * Membership Id
71 *
72 * @var int unsigned
73 */
74 public $id;
75 /**
76 * Name for Membership Status
77 *
78 * @var string
79 */
80 public $entity_table;
81 /**
82 * FK to civicrm_contribution_page.id
83 *
84 * @var int unsigned
85 */
86 public $entity_id;
87 /**
88 * Membership types to be exposed by this block
89 *
90 * @var string
91 */
92 public $membership_types;
93 /**
94 * Optional foreign key to membership_type
95 *
96 * @var int unsigned
97 */
98 public $membership_type_default;
99 /**
100 * Display minimum membership fee
101 *
102 * @var boolean
103 */
104 public $display_min_fee;
105 /**
106 * Should membership transactions be processed separately
107 *
108 * @var boolean
109 */
110 public $is_separate_payment;
111 /**
112 * Title to display at top of block
113 *
114 * @var string
115 */
116 public $new_title;
117 /**
118 * Text to display below title
119 *
120 * @var text
121 */
122 public $new_text;
123 /**
124 * Title for renewal
125 *
126 * @var string
127 */
128 public $renewal_title;
129 /**
130 * Text to display for member renewal
131 *
132 * @var text
133 */
134 public $renewal_text;
135 /**
136 * Is membership sign up optional
137 *
138 * @var boolean
139 */
140 public $is_required;
141 /**
142 * Is this membership_block enabled
143 *
144 * @var boolean
145 */
146 public $is_active;
147 /**
148 * class constructor
149 *
150 * @return civicrm_membership_block
151 */
152 function __construct() {
153 $this->__table = 'civicrm_membership_block';
154 parent::__construct();
155 }
156 /**
157 * Returns foreign keys and entity references
158 *
159 * @return array
160 * [CRM_Core_Reference_Interface]
161 */
162 static function getReferenceColumns() {
163 if (!self::$_links) {
164 self::$_links = static ::createReferenceColumns(__CLASS__);
165 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'entity_id', 'civicrm_contribution_page', 'id');
166 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'membership_type_default', 'civicrm_membership_type', 'id');
167 }
168 return self::$_links;
169 }
170 /**
171 * Returns all the column names of this table
172 *
173 * @return array
174 */
175 static function &fields() {
176 if (!(self::$_fields)) {
177 self::$_fields = array(
178 'id' => array(
179 'name' => 'id',
180 'type' => CRM_Utils_Type::T_INT,
181 'title' => ts('Membership Block ID') ,
182 'description' => 'Membership Id',
183 'required' => true,
184 ) ,
185 'entity_table' => array(
186 'name' => 'entity_table',
187 'type' => CRM_Utils_Type::T_STRING,
188 'title' => ts('Membership Block Entity Table') ,
189 'description' => 'Name for Membership Status',
190 'maxlength' => 64,
191 'size' => CRM_Utils_Type::BIG,
192 ) ,
193 'entity_id' => array(
194 'name' => 'entity_id',
195 'type' => CRM_Utils_Type::T_INT,
196 'title' => ts('Membership Block Entity ID') ,
197 'description' => 'FK to civicrm_contribution_page.id',
198 'required' => true,
199 'FKClassName' => 'CRM_Contribute_DAO_ContributionPage',
200 ) ,
201 'membership_types' => array(
202 'name' => 'membership_types',
203 'type' => CRM_Utils_Type::T_STRING,
204 'title' => ts('Membership Block Membership Types') ,
205 'description' => 'Membership types to be exposed by this block',
206 'maxlength' => 1024,
207 'size' => CRM_Utils_Type::HUGE,
208 ) ,
209 'membership_type_default' => array(
210 'name' => 'membership_type_default',
211 'type' => CRM_Utils_Type::T_INT,
212 'title' => ts('Membership Block Default Type') ,
213 'description' => 'Optional foreign key to membership_type',
214 'FKClassName' => 'CRM_Member_DAO_MembershipType',
215 ) ,
216 'display_min_fee' => array(
217 'name' => 'display_min_fee',
218 'type' => CRM_Utils_Type::T_BOOLEAN,
219 'title' => ts('Membership Block Display Minimum Fee') ,
220 'description' => 'Display minimum membership fee',
221 'default' => '1',
222 ) ,
223 'is_separate_payment' => array(
224 'name' => 'is_separate_payment',
225 'type' => CRM_Utils_Type::T_BOOLEAN,
226 'title' => ts('Membership Block Is Separate Payment') ,
227 'description' => 'Should membership transactions be processed separately',
228 'default' => '1',
229 ) ,
230 'new_title' => array(
231 'name' => 'new_title',
232 'type' => CRM_Utils_Type::T_STRING,
233 'title' => ts('Membership Block New Title') ,
234 'description' => 'Title to display at top of block',
235 'maxlength' => 255,
236 'size' => CRM_Utils_Type::HUGE,
237 ) ,
238 'new_text' => array(
239 'name' => 'new_text',
240 'type' => CRM_Utils_Type::T_TEXT,
241 'title' => ts('Membership Block New Text') ,
242 'description' => 'Text to display below title',
243 ) ,
244 'renewal_title' => array(
245 'name' => 'renewal_title',
246 'type' => CRM_Utils_Type::T_STRING,
247 'title' => ts('Membership Block Renewal Title') ,
248 'description' => 'Title for renewal',
249 'maxlength' => 255,
250 'size' => CRM_Utils_Type::HUGE,
251 ) ,
252 'renewal_text' => array(
253 'name' => 'renewal_text',
254 'type' => CRM_Utils_Type::T_TEXT,
255 'title' => ts('Membership Block Renewal Text') ,
256 'description' => 'Text to display for member renewal',
257 ) ,
258 'is_required' => array(
259 'name' => 'is_required',
260 'type' => CRM_Utils_Type::T_BOOLEAN,
261 'title' => ts('Is Required') ,
262 'description' => 'Is membership sign up optional',
263 ) ,
264 'is_active' => array(
265 'name' => 'is_active',
266 'type' => CRM_Utils_Type::T_BOOLEAN,
267 'title' => ts('Is Active') ,
268 'description' => 'Is this membership_block enabled',
269 'default' => '1',
270 ) ,
271 );
272 }
273 return self::$_fields;
274 }
275 /**
276 * Returns an array containing, for each field, the arary key used for that
277 * field in self::$_fields.
278 *
279 * @return array
280 */
281 static function &fieldKeys() {
282 if (!(self::$_fieldKeys)) {
283 self::$_fieldKeys = array(
284 'id' => 'id',
285 'entity_table' => 'entity_table',
286 'entity_id' => 'entity_id',
287 'membership_types' => 'membership_types',
288 'membership_type_default' => 'membership_type_default',
289 'display_min_fee' => 'display_min_fee',
290 'is_separate_payment' => 'is_separate_payment',
291 'new_title' => 'new_title',
292 'new_text' => 'new_text',
293 'renewal_title' => 'renewal_title',
294 'renewal_text' => 'renewal_text',
295 'is_required' => 'is_required',
296 'is_active' => 'is_active',
297 );
298 }
299 return self::$_fieldKeys;
300 }
301 /**
302 * Returns the names of this table
303 *
304 * @return string
305 */
306 static function getTableName() {
307 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
308 }
309 /**
310 * Returns if this table needs to be logged
311 *
312 * @return boolean
313 */
314 function getLog() {
315 return self::$_log;
316 }
317 /**
318 * Returns the list of fields that can be imported
319 *
320 * @param bool $prefix
321 *
322 * @return array
323 */
324 static function &import($prefix = false) {
325 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'membership_block', $prefix, array());
326 return $r;
327 }
328 /**
329 * Returns the list of fields that can be exported
330 *
331 * @param bool $prefix
332 *
333 * @return array
334 */
335 static function &export($prefix = false) {
336 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'membership_block', $prefix, array());
337 return $r;
338 }
339 }