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