5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Pledge/PledgeBlock.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:748faa657d316e3de8124c5a1ecb7095)
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 public static $_tableName = 'civicrm_pledge_block';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
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 'where' => 'civicrm_pledge_block.id',
146 'table_name' => 'civicrm_pledge_block',
147 'entity' => 'PledgeBlock',
148 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
152 'name' => 'entity_table',
153 'type' => CRM_Utils_Type
::T_STRING
,
154 'title' => ts('Entity Table'),
155 'description' => ts('physical tablename for entity being joined to pledge, e.g. civicrm_contact'),
157 'size' => CRM_Utils_Type
::BIG
,
158 'where' => 'civicrm_pledge_block.entity_table',
159 'table_name' => 'civicrm_pledge_block',
160 'entity' => 'PledgeBlock',
161 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
165 'name' => 'entity_id',
166 'type' => CRM_Utils_Type
::T_INT
,
167 'title' => ts('Entity Id'),
168 'description' => ts('FK to entity table specified in entity_table column.'),
170 'where' => 'civicrm_pledge_block.entity_id',
171 'table_name' => 'civicrm_pledge_block',
172 'entity' => 'PledgeBlock',
173 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
176 'pledge_frequency_unit' => [
177 'name' => 'pledge_frequency_unit',
178 'type' => CRM_Utils_Type
::T_STRING
,
179 'title' => ts('Pledge Frequency Unit'),
180 'description' => ts('Delimited list of supported frequency units'),
182 'size' => CRM_Utils_Type
::HUGE
,
183 'where' => 'civicrm_pledge_block.pledge_frequency_unit',
184 'table_name' => 'civicrm_pledge_block',
185 'entity' => 'PledgeBlock',
186 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
188 'serialize' => self
::SERIALIZE_SEPARATOR_TRIMMED
,
190 'is_pledge_interval' => [
191 'name' => 'is_pledge_interval',
192 'type' => CRM_Utils_Type
::T_BOOLEAN
,
193 'title' => ts('Expose Frequency Interval?'),
194 'description' => ts('Is frequency interval exposed on the contribution form.'),
195 'where' => 'civicrm_pledge_block.is_pledge_interval',
197 'table_name' => 'civicrm_pledge_block',
198 'entity' => 'PledgeBlock',
199 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
203 'name' => 'max_reminders',
204 'type' => CRM_Utils_Type
::T_INT
,
205 'title' => ts('Maximum Number of Reminders'),
206 'description' => ts('The maximum number of payment reminders to send for any given payment.'),
207 'where' => 'civicrm_pledge_block.max_reminders',
209 'table_name' => 'civicrm_pledge_block',
210 'entity' => 'PledgeBlock',
211 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
214 'initial_reminder_day' => [
215 'name' => 'initial_reminder_day',
216 'type' => CRM_Utils_Type
::T_INT
,
217 'title' => ts('Initial Reminder Day'),
218 'description' => ts('Send initial reminder this many days prior to the payment due date.'),
219 'where' => 'civicrm_pledge_block.initial_reminder_day',
221 'table_name' => 'civicrm_pledge_block',
222 'entity' => 'PledgeBlock',
223 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
226 'additional_reminder_day' => [
227 'name' => 'additional_reminder_day',
228 'type' => CRM_Utils_Type
::T_INT
,
229 'title' => ts('Additional Reminder Days'),
230 'description' => ts('Send additional reminder this many days after last one sent, up to maximum number of reminders.'),
231 'where' => 'civicrm_pledge_block.additional_reminder_day',
233 'table_name' => 'civicrm_pledge_block',
234 'entity' => 'PledgeBlock',
235 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
238 'pledge_start_date' => [
239 'name' => 'pledge_start_date',
240 'type' => CRM_Utils_Type
::T_STRING
,
241 'title' => ts('Pledge Start Date'),
242 'description' => ts('The date the first scheduled pledge occurs.'),
244 'size' => CRM_Utils_Type
::BIG
,
245 'where' => 'civicrm_pledge_block.pledge_start_date',
246 'table_name' => 'civicrm_pledge_block',
247 'entity' => 'PledgeBlock',
248 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
251 'is_pledge_start_date_visible' => [
252 'name' => 'is_pledge_start_date_visible',
253 'type' => CRM_Utils_Type
::T_BOOLEAN
,
254 'title' => ts('Show Recurring Donation Start Date?'),
255 'description' => ts('If true - recurring start date is shown.'),
257 'where' => 'civicrm_pledge_block.is_pledge_start_date_visible',
259 'table_name' => 'civicrm_pledge_block',
260 'entity' => 'PledgeBlock',
261 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
264 'is_pledge_start_date_editable' => [
265 'name' => 'is_pledge_start_date_editable',
266 'type' => CRM_Utils_Type
::T_BOOLEAN
,
267 'title' => ts('Allow Edits to Recurring Donation Start Date?'),
268 'description' => ts('If true - recurring start date is editable.'),
270 'where' => 'civicrm_pledge_block.is_pledge_start_date_editable',
272 'table_name' => 'civicrm_pledge_block',
273 'entity' => 'PledgeBlock',
274 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
278 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
280 return Civi
::$statics[__CLASS__
]['fields'];
284 * Return a mapping from field-name to the corresponding key (as used in fields()).
287 * Array(string $name => string $uniqueName).
289 public static function &fieldKeys() {
290 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
291 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
293 return Civi
::$statics[__CLASS__
]['fieldKeys'];
297 * Returns the names of this table
301 public static function getTableName() {
302 return self
::$_tableName;
306 * Returns if this table needs to be logged
310 public function getLog() {
315 * Returns the list of fields that can be imported
317 * @param bool $prefix
321 public static function &import($prefix = FALSE) {
322 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'pledge_block', $prefix, []);
327 * Returns the list of fields that can be exported
329 * @param bool $prefix
333 public static function &export($prefix = FALSE) {
334 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'pledge_block', $prefix, []);
339 * Returns the list of indices
341 * @param bool $localize
345 public static function indices($localize = TRUE) {
348 'name' => 'index_entity',
353 'localizable' => FALSE,
354 'sig' => 'civicrm_pledge_block::0::entity_table::entity_id',
357 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;