Merge pull request #8863 from fuzionnz/CRM-19215
[civicrm-core.git] / CRM / Pledge / DAO / PledgeBlock.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/Pledge/PledgeBlock.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:884b8af4af4d96ca57a59d3bfe2d0634)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Pledge_DAO_PledgeBlock extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_pledge_block';
44 /**
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
47 *
48 * @var boolean
49 */
50 static $_log = true;
51 /**
52 * Pledge ID
53 *
54 * @var int unsigned
55 */
56 public $id;
57 /**
58 * physical tablename for entity being joined to pledge, e.g. civicrm_contact
59 *
60 * @var string
61 */
62 public $entity_table;
63 /**
64 * FK to entity table specified in entity_table column.
65 *
66 * @var int unsigned
67 */
68 public $entity_id;
69 /**
70 * Delimited list of supported frequency units
71 *
72 * @var string
73 */
74 public $pledge_frequency_unit;
75 /**
76 * Is frequency interval exposed on the contribution form.
77 *
78 * @var boolean
79 */
80 public $is_pledge_interval;
81 /**
82 * The maximum number of payment reminders to send for any given payment.
83 *
84 * @var int unsigned
85 */
86 public $max_reminders;
87 /**
88 * Send initial reminder this many days prior to the payment due date.
89 *
90 * @var int unsigned
91 */
92 public $initial_reminder_day;
93 /**
94 * Send additional reminder this many days after last one sent, up to maximum number of reminders.
95 *
96 * @var int unsigned
97 */
98 public $additional_reminder_day;
99 /**
100 * The date the first scheduled pledge occurs.
101 *
102 * @var string
103 */
104 public $pledge_start_date;
105 /**
106 * If true - recurring start date is shown.
107 *
108 * @var boolean
109 */
110 public $is_pledge_start_date_visible;
111 /**
112 * If true - recurring start date is editable.
113 *
114 * @var boolean
115 */
116 public $is_pledge_start_date_editable;
117 /**
118 * class constructor
119 *
120 * @return civicrm_pledge_block
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 ) ,
155 'entity_table' => array(
156 'name' => 'entity_table',
157 'type' => CRM_Utils_Type::T_STRING,
158 'title' => ts('Entity Table') ,
159 'description' => 'physical tablename for entity being joined to pledge, e.g. civicrm_contact',
160 'maxlength' => 64,
161 'size' => CRM_Utils_Type::BIG,
162 ) ,
163 'entity_id' => array(
164 'name' => 'entity_id',
165 'type' => CRM_Utils_Type::T_INT,
166 'title' => ts('Entity Id') ,
167 'description' => 'FK to entity table specified in entity_table column.',
168 'required' => true,
169 ) ,
170 'pledge_frequency_unit' => array(
171 'name' => 'pledge_frequency_unit',
172 'type' => CRM_Utils_Type::T_STRING,
173 'title' => ts('Pledge Frequency Unit') ,
174 'description' => 'Delimited list of supported frequency units',
175 'maxlength' => 128,
176 'size' => CRM_Utils_Type::HUGE,
177 ) ,
178 'is_pledge_interval' => array(
179 'name' => 'is_pledge_interval',
180 'type' => CRM_Utils_Type::T_BOOLEAN,
181 'title' => ts('Expose Frequency Interval?') ,
182 'description' => 'Is frequency interval exposed on the contribution form.',
183 ) ,
184 'max_reminders' => array(
185 'name' => 'max_reminders',
186 'type' => CRM_Utils_Type::T_INT,
187 'title' => ts('Maximum Number of Reminders') ,
188 'description' => 'The maximum number of payment reminders to send for any given payment.',
189 'default' => '1',
190 ) ,
191 'initial_reminder_day' => array(
192 'name' => 'initial_reminder_day',
193 'type' => CRM_Utils_Type::T_INT,
194 'title' => ts('Initial Reminder Day') ,
195 'description' => 'Send initial reminder this many days prior to the payment due date.',
196 'default' => '5',
197 ) ,
198 'additional_reminder_day' => array(
199 'name' => 'additional_reminder_day',
200 'type' => CRM_Utils_Type::T_INT,
201 'title' => ts('Additional Reminder Days') ,
202 'description' => 'Send additional reminder this many days after last one sent, up to maximum number of reminders.',
203 'default' => '5',
204 ) ,
205 'pledge_start_date' => array(
206 'name' => 'pledge_start_date',
207 'type' => CRM_Utils_Type::T_STRING,
208 'title' => ts('Pledge Start Date') ,
209 'description' => 'The date the first scheduled pledge occurs.',
210 'maxlength' => 64,
211 'size' => CRM_Utils_Type::BIG,
212 ) ,
213 'is_pledge_start_date_visible' => array(
214 'name' => 'is_pledge_start_date_visible',
215 'type' => CRM_Utils_Type::T_BOOLEAN,
216 'title' => ts('Show Recurring Donation Start Date?') ,
217 'description' => 'If true - recurring start date is shown.',
218 'required' => true,
219 ) ,
220 'is_pledge_start_date_editable' => array(
221 'name' => 'is_pledge_start_date_editable',
222 'type' => CRM_Utils_Type::T_BOOLEAN,
223 'title' => ts('Allow Edits to Recurring Donation Start Date?') ,
224 'description' => 'If true - recurring start date is editable.',
225 'required' => true,
226 ) ,
227 );
228 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
229 }
230 return Civi::$statics[__CLASS__]['fields'];
231 }
232 /**
233 * Return a mapping from field-name to the corresponding key (as used in fields()).
234 *
235 * @return array
236 * Array(string $name => string $uniqueName).
237 */
238 static function &fieldKeys() {
239 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
240 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
241 }
242 return Civi::$statics[__CLASS__]['fieldKeys'];
243 }
244 /**
245 * Returns the names of this table
246 *
247 * @return string
248 */
249 static function getTableName() {
250 return self::$_tableName;
251 }
252 /**
253 * Returns if this table needs to be logged
254 *
255 * @return boolean
256 */
257 function getLog() {
258 return self::$_log;
259 }
260 /**
261 * Returns the list of fields that can be imported
262 *
263 * @param bool $prefix
264 *
265 * @return array
266 */
267 static function &import($prefix = false) {
268 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'pledge_block', $prefix, array());
269 return $r;
270 }
271 /**
272 * Returns the list of fields that can be exported
273 *
274 * @param bool $prefix
275 *
276 * @return array
277 */
278 static function &export($prefix = false) {
279 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'pledge_block', $prefix, array());
280 return $r;
281 }
282 }