5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Pledge/PledgeBlock.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:cdc529b617a76a84e18455737f4e7a03)
13 * Database access object for the PledgeBlock entity.
15 class CRM_Pledge_DAO_PledgeBlock
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 static $_tableName = 'civicrm_pledge_block';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
39 * physical tablename for entity being joined to pledge, e.g. civicrm_contact
46 * FK to entity table specified in entity_table column.
53 * Delimited list of supported frequency units
57 public $pledge_frequency_unit;
60 * Is frequency interval exposed on the contribution form.
64 public $is_pledge_interval;
67 * The maximum number of payment reminders to send for any given payment.
71 public $max_reminders;
74 * Send initial reminder this many days prior to the payment due date.
78 public $initial_reminder_day;
81 * Send additional reminder this many days after last one sent, up to maximum number of reminders.
85 public $additional_reminder_day;
88 * The date the first scheduled pledge occurs.
92 public $pledge_start_date;
95 * If true - recurring start date is shown.
99 public $is_pledge_start_date_visible;
102 * If true - recurring start date is editable.
106 public $is_pledge_start_date_editable;
111 public function __construct() {
112 $this->__table
= 'civicrm_pledge_block';
113 parent
::__construct();
117 * Returns foreign keys and entity references.
120 * [CRM_Core_Reference_Interface]
122 public static function getReferenceColumns() {
123 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
124 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
125 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
126 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
128 return Civi
::$statics[__CLASS__
]['links'];
132 * Returns all the column names of this table
136 public static function &fields() {
137 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
138 Civi
::$statics[__CLASS__
]['fields'] = [
141 'type' => CRM_Utils_Type
::T_INT
,
142 'title' => ts('Pledge Block ID'),
143 'description' => ts('Pledge ID'),
145 'table_name' => 'civicrm_pledge_block',
146 'entity' => 'PledgeBlock',
147 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
151 'name' => 'entity_table',
152 'type' => CRM_Utils_Type
::T_STRING
,
153 'title' => ts('Entity Table'),
154 'description' => ts('physical tablename for entity being joined to pledge, e.g. civicrm_contact'),
156 'size' => CRM_Utils_Type
::BIG
,
157 'table_name' => 'civicrm_pledge_block',
158 'entity' => 'PledgeBlock',
159 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
163 'name' => 'entity_id',
164 'type' => CRM_Utils_Type
::T_INT
,
165 'title' => ts('Entity Id'),
166 'description' => ts('FK to entity table specified in entity_table column.'),
168 'table_name' => 'civicrm_pledge_block',
169 'entity' => 'PledgeBlock',
170 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
173 'pledge_frequency_unit' => [
174 'name' => 'pledge_frequency_unit',
175 'type' => CRM_Utils_Type
::T_STRING
,
176 'title' => ts('Pledge Frequency Unit'),
177 'description' => ts('Delimited list of supported frequency units'),
179 'size' => CRM_Utils_Type
::HUGE
,
180 'table_name' => 'civicrm_pledge_block',
181 'entity' => 'PledgeBlock',
182 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
184 'serialize' => self
::SERIALIZE_SEPARATOR_TRIMMED
,
186 'is_pledge_interval' => [
187 'name' => 'is_pledge_interval',
188 'type' => CRM_Utils_Type
::T_BOOLEAN
,
189 'title' => ts('Expose Frequency Interval?'),
190 'description' => ts('Is frequency interval exposed on the contribution form.'),
192 'table_name' => 'civicrm_pledge_block',
193 'entity' => 'PledgeBlock',
194 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
198 'name' => 'max_reminders',
199 'type' => CRM_Utils_Type
::T_INT
,
200 'title' => ts('Maximum Number of Reminders'),
201 'description' => ts('The maximum number of payment reminders to send for any given payment.'),
203 'table_name' => 'civicrm_pledge_block',
204 'entity' => 'PledgeBlock',
205 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
208 'initial_reminder_day' => [
209 'name' => 'initial_reminder_day',
210 'type' => CRM_Utils_Type
::T_INT
,
211 'title' => ts('Initial Reminder Day'),
212 'description' => ts('Send initial reminder this many days prior to the payment due date.'),
214 'table_name' => 'civicrm_pledge_block',
215 'entity' => 'PledgeBlock',
216 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
219 'additional_reminder_day' => [
220 'name' => 'additional_reminder_day',
221 'type' => CRM_Utils_Type
::T_INT
,
222 'title' => ts('Additional Reminder Days'),
223 'description' => ts('Send additional reminder this many days after last one sent, up to maximum number of reminders.'),
225 'table_name' => 'civicrm_pledge_block',
226 'entity' => 'PledgeBlock',
227 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
230 'pledge_start_date' => [
231 'name' => 'pledge_start_date',
232 'type' => CRM_Utils_Type
::T_STRING
,
233 'title' => ts('Pledge Start Date'),
234 'description' => ts('The date the first scheduled pledge occurs.'),
236 'size' => CRM_Utils_Type
::BIG
,
237 'table_name' => 'civicrm_pledge_block',
238 'entity' => 'PledgeBlock',
239 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
242 'is_pledge_start_date_visible' => [
243 'name' => 'is_pledge_start_date_visible',
244 'type' => CRM_Utils_Type
::T_BOOLEAN
,
245 'title' => ts('Show Recurring Donation Start Date?'),
246 'description' => ts('If true - recurring start date is shown.'),
249 'table_name' => 'civicrm_pledge_block',
250 'entity' => 'PledgeBlock',
251 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
254 'is_pledge_start_date_editable' => [
255 'name' => 'is_pledge_start_date_editable',
256 'type' => CRM_Utils_Type
::T_BOOLEAN
,
257 'title' => ts('Allow Edits to Recurring Donation Start Date?'),
258 'description' => ts('If true - recurring start date is editable.'),
261 'table_name' => 'civicrm_pledge_block',
262 'entity' => 'PledgeBlock',
263 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
267 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
269 return Civi
::$statics[__CLASS__
]['fields'];
273 * Return a mapping from field-name to the corresponding key (as used in fields()).
276 * Array(string $name => string $uniqueName).
278 public static function &fieldKeys() {
279 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
280 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
282 return Civi
::$statics[__CLASS__
]['fieldKeys'];
286 * Returns the names of this table
290 public static function getTableName() {
291 return self
::$_tableName;
295 * Returns if this table needs to be logged
299 public function getLog() {
304 * Returns the list of fields that can be imported
306 * @param bool $prefix
310 public static function &import($prefix = FALSE) {
311 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'pledge_block', $prefix, []);
316 * Returns the list of fields that can be exported
318 * @param bool $prefix
322 public static function &export($prefix = FALSE) {
323 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'pledge_block', $prefix, []);
328 * Returns the list of indices
330 * @param bool $localize
334 public static function indices($localize = TRUE) {
337 'name' => 'index_entity',
342 'localizable' => FALSE,
343 'sig' => 'civicrm_pledge_block::0::entity_table::entity_id',
346 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;