CRM-19925 Updated DAO files
[civicrm-core.git] / CRM / Pledge / DAO / PledgeBlock.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
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-2017
30 *
31 * Generated from xml/schema/CRM/Pledge/PledgeBlock.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:ae4e663c058d6484605ac75df78fef1f)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Pledge_DAO_PledgeBlock constructor.
39 */
40 class CRM_Pledge_DAO_PledgeBlock extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_pledge_block';
47 /**
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
49 *
50 * @var boolean
51 */
52 static $_log = true;
53 /**
54 * Pledge ID
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 * physical tablename for entity being joined to pledge, e.g. civicrm_contact
61 *
62 * @var string
63 */
64 public $entity_table;
65 /**
66 * FK to entity table specified in entity_table column.
67 *
68 * @var int unsigned
69 */
70 public $entity_id;
71 /**
72 * Delimited list of supported frequency units
73 *
74 * @var string
75 */
76 public $pledge_frequency_unit;
77 /**
78 * Is frequency interval exposed on the contribution form.
79 *
80 * @var boolean
81 */
82 public $is_pledge_interval;
83 /**
84 * The maximum number of payment reminders to send for any given payment.
85 *
86 * @var int unsigned
87 */
88 public $max_reminders;
89 /**
90 * Send initial reminder this many days prior to the payment due date.
91 *
92 * @var int unsigned
93 */
94 public $initial_reminder_day;
95 /**
96 * Send additional reminder this many days after last one sent, up to maximum number of reminders.
97 *
98 * @var int unsigned
99 */
100 public $additional_reminder_day;
101 /**
102 * The date the first scheduled pledge occurs.
103 *
104 * @var string
105 */
106 public $pledge_start_date;
107 /**
108 * If true - recurring start date is shown.
109 *
110 * @var boolean
111 */
112 public $is_pledge_start_date_visible;
113 /**
114 * If true - recurring start date is editable.
115 *
116 * @var boolean
117 */
118 public $is_pledge_start_date_editable;
119 /**
120 * Class constructor.
121 */
122 function __construct() {
123 $this->__table = 'civicrm_pledge_block';
124 parent::__construct();
125 }
126 /**
127 * Returns foreign keys and entity references.
128 *
129 * @return array
130 * [CRM_Core_Reference_Interface]
131 */
132 static function getReferenceColumns() {
133 if (!isset(Civi::$statics[__CLASS__]['links'])) {
134 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
135 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Dynamic(self::getTableName() , 'entity_id', NULL, 'id', 'entity_table');
136 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
137 }
138 return Civi::$statics[__CLASS__]['links'];
139 }
140 /**
141 * Returns all the column names of this table
142 *
143 * @return array
144 */
145 static function &fields() {
146 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
147 Civi::$statics[__CLASS__]['fields'] = array(
148 'id' => array(
149 'name' => 'id',
150 'type' => CRM_Utils_Type::T_INT,
151 'title' => ts('Pledge Block ID') ,
152 'description' => 'Pledge ID',
153 'required' => true,
154 'table_name' => 'civicrm_pledge_block',
155 'entity' => 'PledgeBlock',
156 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
157 ) ,
158 'entity_table' => array(
159 'name' => 'entity_table',
160 'type' => CRM_Utils_Type::T_STRING,
161 'title' => ts('Entity Table') ,
162 'description' => 'physical tablename for entity being joined to pledge, e.g. civicrm_contact',
163 'maxlength' => 64,
164 'size' => CRM_Utils_Type::BIG,
165 'table_name' => 'civicrm_pledge_block',
166 'entity' => 'PledgeBlock',
167 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
168 ) ,
169 'entity_id' => array(
170 'name' => 'entity_id',
171 'type' => CRM_Utils_Type::T_INT,
172 'title' => ts('Entity Id') ,
173 'description' => 'FK to entity table specified in entity_table column.',
174 'required' => true,
175 'table_name' => 'civicrm_pledge_block',
176 'entity' => 'PledgeBlock',
177 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
178 ) ,
179 'pledge_frequency_unit' => array(
180 'name' => 'pledge_frequency_unit',
181 'type' => CRM_Utils_Type::T_STRING,
182 'title' => ts('Pledge Frequency Unit') ,
183 'description' => 'Delimited list of supported frequency units',
184 'maxlength' => 128,
185 'size' => CRM_Utils_Type::HUGE,
186 'table_name' => 'civicrm_pledge_block',
187 'entity' => 'PledgeBlock',
188 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
189 ) ,
190 'is_pledge_interval' => array(
191 'name' => 'is_pledge_interval',
192 'type' => CRM_Utils_Type::T_BOOLEAN,
193 'title' => ts('Expose Frequency Interval?') ,
194 'description' => 'Is frequency interval exposed on the contribution form.',
195 'table_name' => 'civicrm_pledge_block',
196 'entity' => 'PledgeBlock',
197 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
198 ) ,
199 'max_reminders' => array(
200 'name' => 'max_reminders',
201 'type' => CRM_Utils_Type::T_INT,
202 'title' => ts('Maximum Number of Reminders') ,
203 'description' => 'The maximum number of payment reminders to send for any given payment.',
204 'default' => '1',
205 'table_name' => 'civicrm_pledge_block',
206 'entity' => 'PledgeBlock',
207 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
208 ) ,
209 'initial_reminder_day' => array(
210 'name' => 'initial_reminder_day',
211 'type' => CRM_Utils_Type::T_INT,
212 'title' => ts('Initial Reminder Day') ,
213 'description' => 'Send initial reminder this many days prior to the payment due date.',
214 'default' => '5',
215 'table_name' => 'civicrm_pledge_block',
216 'entity' => 'PledgeBlock',
217 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
218 ) ,
219 'additional_reminder_day' => array(
220 'name' => 'additional_reminder_day',
221 'type' => CRM_Utils_Type::T_INT,
222 'title' => ts('Additional Reminder Days') ,
223 'description' => 'Send additional reminder this many days after last one sent, up to maximum number of reminders.',
224 'default' => '5',
225 'table_name' => 'civicrm_pledge_block',
226 'entity' => 'PledgeBlock',
227 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
228 ) ,
229 'pledge_start_date' => array(
230 'name' => 'pledge_start_date',
231 'type' => CRM_Utils_Type::T_STRING,
232 'title' => ts('Pledge Start Date') ,
233 'description' => 'The date the first scheduled pledge occurs.',
234 'maxlength' => 64,
235 'size' => CRM_Utils_Type::BIG,
236 'table_name' => 'civicrm_pledge_block',
237 'entity' => 'PledgeBlock',
238 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
239 ) ,
240 'is_pledge_start_date_visible' => array(
241 'name' => 'is_pledge_start_date_visible',
242 'type' => CRM_Utils_Type::T_BOOLEAN,
243 'title' => ts('Show Recurring Donation Start Date?') ,
244 'description' => 'If true - recurring start date is shown.',
245 'required' => true,
246 'table_name' => 'civicrm_pledge_block',
247 'entity' => 'PledgeBlock',
248 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
249 ) ,
250 'is_pledge_start_date_editable' => array(
251 'name' => 'is_pledge_start_date_editable',
252 'type' => CRM_Utils_Type::T_BOOLEAN,
253 'title' => ts('Allow Edits to Recurring Donation Start Date?') ,
254 'description' => 'If true - recurring start date is editable.',
255 'required' => true,
256 'table_name' => 'civicrm_pledge_block',
257 'entity' => 'PledgeBlock',
258 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
259 ) ,
260 );
261 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
262 }
263 return Civi::$statics[__CLASS__]['fields'];
264 }
265 /**
266 * Return a mapping from field-name to the corresponding key (as used in fields()).
267 *
268 * @return array
269 * Array(string $name => string $uniqueName).
270 */
271 static function &fieldKeys() {
272 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
273 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
274 }
275 return Civi::$statics[__CLASS__]['fieldKeys'];
276 }
277 /**
278 * Returns the names of this table
279 *
280 * @return string
281 */
282 static function getTableName() {
283 return self::$_tableName;
284 }
285 /**
286 * Returns if this table needs to be logged
287 *
288 * @return boolean
289 */
290 function getLog() {
291 return self::$_log;
292 }
293 /**
294 * Returns the list of fields that can be imported
295 *
296 * @param bool $prefix
297 *
298 * @return array
299 */
300 static function &import($prefix = false) {
301 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'pledge_block', $prefix, array());
302 return $r;
303 }
304 /**
305 * Returns the list of fields that can be exported
306 *
307 * @param bool $prefix
308 *
309 * @return array
310 */
311 static function &export($prefix = false) {
312 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'pledge_block', $prefix, array());
313 return $r;
314 }
315 }