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:2b02296af6d4e280950d483d222b20b9)
13 * Database access object for the PledgeBlock entity.
15 class CRM_Pledge_DAO_PledgeBlock
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '2.1';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_pledge_block';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = TRUE;
41 * physical tablename for entity being joined to pledge, e.g. civicrm_contact
48 * FK to entity table specified in entity_table column.
55 * Delimited list of supported frequency units
59 public $pledge_frequency_unit;
62 * Is frequency interval exposed on the contribution form.
66 public $is_pledge_interval;
69 * The maximum number of payment reminders to send for any given payment.
73 public $max_reminders;
76 * Send initial reminder this many days prior to the payment due date.
80 public $initial_reminder_day;
83 * Send additional reminder this many days after last one sent, up to maximum number of reminders.
87 public $additional_reminder_day;
90 * The date the first scheduled pledge occurs.
94 public $pledge_start_date;
97 * If true - recurring start date is shown.
101 public $is_pledge_start_date_visible;
104 * If true - recurring start date is editable.
108 public $is_pledge_start_date_editable;
113 public function __construct() {
114 $this->__table
= 'civicrm_pledge_block';
115 parent
::__construct();
119 * Returns localized title of this entity.
121 * @param bool $plural
122 * Whether to return the plural version of the title.
124 public static function getEntityTitle($plural = FALSE) {
125 return $plural ?
ts('Pledge Blocks') : ts('Pledge Block');
129 * Returns foreign keys and entity references.
132 * [CRM_Core_Reference_Interface]
134 public static function getReferenceColumns() {
135 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
136 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
137 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
138 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
140 return Civi
::$statics[__CLASS__
]['links'];
144 * Returns all the column names of this table
148 public static function &fields() {
149 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
150 Civi
::$statics[__CLASS__
]['fields'] = [
153 'type' => CRM_Utils_Type
::T_INT
,
154 'title' => ts('Pledge Block ID'),
155 'description' => ts('Pledge ID'),
157 'where' => 'civicrm_pledge_block.id',
158 'table_name' => 'civicrm_pledge_block',
159 'entity' => 'PledgeBlock',
160 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
165 'name' => 'entity_table',
166 'type' => CRM_Utils_Type
::T_STRING
,
167 'title' => ts('Entity Table'),
168 'description' => ts('physical tablename for entity being joined to pledge, e.g. civicrm_contact'),
170 'size' => CRM_Utils_Type
::BIG
,
171 'where' => 'civicrm_pledge_block.entity_table',
172 'table_name' => 'civicrm_pledge_block',
173 'entity' => 'PledgeBlock',
174 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
179 'name' => 'entity_id',
180 'type' => CRM_Utils_Type
::T_INT
,
181 'title' => ts('Entity Id'),
182 'description' => ts('FK to entity table specified in entity_table column.'),
184 'where' => 'civicrm_pledge_block.entity_id',
185 'table_name' => 'civicrm_pledge_block',
186 'entity' => 'PledgeBlock',
187 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
191 'pledge_frequency_unit' => [
192 'name' => 'pledge_frequency_unit',
193 'type' => CRM_Utils_Type
::T_STRING
,
194 'title' => ts('Pledge Frequency Unit'),
195 'description' => ts('Delimited list of supported frequency units'),
197 'size' => CRM_Utils_Type
::HUGE
,
198 'where' => 'civicrm_pledge_block.pledge_frequency_unit',
199 'table_name' => 'civicrm_pledge_block',
200 'entity' => 'PledgeBlock',
201 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
203 'serialize' => self
::SERIALIZE_SEPARATOR_TRIMMED
,
206 'is_pledge_interval' => [
207 'name' => 'is_pledge_interval',
208 'type' => CRM_Utils_Type
::T_BOOLEAN
,
209 'title' => ts('Expose Frequency Interval?'),
210 'description' => ts('Is frequency interval exposed on the contribution form.'),
211 'where' => 'civicrm_pledge_block.is_pledge_interval',
213 'table_name' => 'civicrm_pledge_block',
214 'entity' => 'PledgeBlock',
215 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
220 'name' => 'max_reminders',
221 'type' => CRM_Utils_Type
::T_INT
,
222 'title' => ts('Maximum Number of Reminders'),
223 'description' => ts('The maximum number of payment reminders to send for any given payment.'),
224 'where' => 'civicrm_pledge_block.max_reminders',
226 'table_name' => 'civicrm_pledge_block',
227 'entity' => 'PledgeBlock',
228 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
232 'initial_reminder_day' => [
233 'name' => 'initial_reminder_day',
234 'type' => CRM_Utils_Type
::T_INT
,
235 'title' => ts('Initial Reminder Day'),
236 'description' => ts('Send initial reminder this many days prior to the payment due date.'),
237 'where' => 'civicrm_pledge_block.initial_reminder_day',
239 'table_name' => 'civicrm_pledge_block',
240 'entity' => 'PledgeBlock',
241 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
245 'additional_reminder_day' => [
246 'name' => 'additional_reminder_day',
247 'type' => CRM_Utils_Type
::T_INT
,
248 'title' => ts('Additional Reminder Days'),
249 'description' => ts('Send additional reminder this many days after last one sent, up to maximum number of reminders.'),
250 'where' => 'civicrm_pledge_block.additional_reminder_day',
252 'table_name' => 'civicrm_pledge_block',
253 'entity' => 'PledgeBlock',
254 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
258 'pledge_start_date' => [
259 'name' => 'pledge_start_date',
260 'type' => CRM_Utils_Type
::T_STRING
,
261 'title' => ts('Pledge Start Date'),
262 'description' => ts('The date the first scheduled pledge occurs.'),
264 'size' => CRM_Utils_Type
::BIG
,
265 'where' => 'civicrm_pledge_block.pledge_start_date',
266 'table_name' => 'civicrm_pledge_block',
267 'entity' => 'PledgeBlock',
268 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
272 'is_pledge_start_date_visible' => [
273 'name' => 'is_pledge_start_date_visible',
274 'type' => CRM_Utils_Type
::T_BOOLEAN
,
275 'title' => ts('Show Recurring Donation Start Date?'),
276 'description' => ts('If true - recurring start date is shown.'),
278 'where' => 'civicrm_pledge_block.is_pledge_start_date_visible',
280 'table_name' => 'civicrm_pledge_block',
281 'entity' => 'PledgeBlock',
282 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
286 'is_pledge_start_date_editable' => [
287 'name' => 'is_pledge_start_date_editable',
288 'type' => CRM_Utils_Type
::T_BOOLEAN
,
289 'title' => ts('Allow Edits to Recurring Donation Start Date?'),
290 'description' => ts('If true - recurring start date is editable.'),
292 'where' => 'civicrm_pledge_block.is_pledge_start_date_editable',
294 'table_name' => 'civicrm_pledge_block',
295 'entity' => 'PledgeBlock',
296 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
301 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
303 return Civi
::$statics[__CLASS__
]['fields'];
307 * Return a mapping from field-name to the corresponding key (as used in fields()).
310 * Array(string $name => string $uniqueName).
312 public static function &fieldKeys() {
313 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
314 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
316 return Civi
::$statics[__CLASS__
]['fieldKeys'];
320 * Returns the names of this table
324 public static function getTableName() {
325 return self
::$_tableName;
329 * Returns if this table needs to be logged
333 public function getLog() {
338 * Returns the list of fields that can be imported
340 * @param bool $prefix
344 public static function &import($prefix = FALSE) {
345 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'pledge_block', $prefix, []);
350 * Returns the list of fields that can be exported
352 * @param bool $prefix
356 public static function &export($prefix = FALSE) {
357 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'pledge_block', $prefix, []);
362 * Returns the list of indices
364 * @param bool $localize
368 public static function indices($localize = TRUE) {
371 'name' => 'index_entity',
376 'localizable' => FALSE,
377 'sig' => 'civicrm_pledge_block::0::entity_table::entity_id',
380 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;