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:fd4a1319ac7b6cdc29baa3e9e4df68de)
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 localized title of this entity.
119 public static function getEntityTitle() {
120 return ts('Pledge Blocks');
124 * Returns foreign keys and entity references.
127 * [CRM_Core_Reference_Interface]
129 public static function getReferenceColumns() {
130 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
131 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
132 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
133 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
135 return Civi
::$statics[__CLASS__
]['links'];
139 * Returns all the column names of this table
143 public static function &fields() {
144 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
145 Civi
::$statics[__CLASS__
]['fields'] = [
148 'type' => CRM_Utils_Type
::T_INT
,
149 'title' => ts('Pledge Block ID'),
150 'description' => ts('Pledge ID'),
152 'where' => 'civicrm_pledge_block.id',
153 'table_name' => 'civicrm_pledge_block',
154 'entity' => 'PledgeBlock',
155 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
160 'name' => 'entity_table',
161 'type' => CRM_Utils_Type
::T_STRING
,
162 'title' => ts('Entity Table'),
163 'description' => ts('physical tablename for entity being joined to pledge, e.g. civicrm_contact'),
165 'size' => CRM_Utils_Type
::BIG
,
166 'where' => 'civicrm_pledge_block.entity_table',
167 'table_name' => 'civicrm_pledge_block',
168 'entity' => 'PledgeBlock',
169 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
174 'name' => 'entity_id',
175 'type' => CRM_Utils_Type
::T_INT
,
176 'title' => ts('Entity Id'),
177 'description' => ts('FK to entity table specified in entity_table column.'),
179 'where' => 'civicrm_pledge_block.entity_id',
180 'table_name' => 'civicrm_pledge_block',
181 'entity' => 'PledgeBlock',
182 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
186 'pledge_frequency_unit' => [
187 'name' => 'pledge_frequency_unit',
188 'type' => CRM_Utils_Type
::T_STRING
,
189 'title' => ts('Pledge Frequency Unit'),
190 'description' => ts('Delimited list of supported frequency units'),
192 'size' => CRM_Utils_Type
::HUGE
,
193 'where' => 'civicrm_pledge_block.pledge_frequency_unit',
194 'table_name' => 'civicrm_pledge_block',
195 'entity' => 'PledgeBlock',
196 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
198 'serialize' => self
::SERIALIZE_SEPARATOR_TRIMMED
,
201 'is_pledge_interval' => [
202 'name' => 'is_pledge_interval',
203 'type' => CRM_Utils_Type
::T_BOOLEAN
,
204 'title' => ts('Expose Frequency Interval?'),
205 'description' => ts('Is frequency interval exposed on the contribution form.'),
206 'where' => 'civicrm_pledge_block.is_pledge_interval',
208 'table_name' => 'civicrm_pledge_block',
209 'entity' => 'PledgeBlock',
210 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
215 'name' => 'max_reminders',
216 'type' => CRM_Utils_Type
::T_INT
,
217 'title' => ts('Maximum Number of Reminders'),
218 'description' => ts('The maximum number of payment reminders to send for any given payment.'),
219 'where' => 'civicrm_pledge_block.max_reminders',
221 'table_name' => 'civicrm_pledge_block',
222 'entity' => 'PledgeBlock',
223 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
227 'initial_reminder_day' => [
228 'name' => 'initial_reminder_day',
229 'type' => CRM_Utils_Type
::T_INT
,
230 'title' => ts('Initial Reminder Day'),
231 'description' => ts('Send initial reminder this many days prior to the payment due date.'),
232 'where' => 'civicrm_pledge_block.initial_reminder_day',
234 'table_name' => 'civicrm_pledge_block',
235 'entity' => 'PledgeBlock',
236 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
240 'additional_reminder_day' => [
241 'name' => 'additional_reminder_day',
242 'type' => CRM_Utils_Type
::T_INT
,
243 'title' => ts('Additional Reminder Days'),
244 'description' => ts('Send additional reminder this many days after last one sent, up to maximum number of reminders.'),
245 'where' => 'civicrm_pledge_block.additional_reminder_day',
247 'table_name' => 'civicrm_pledge_block',
248 'entity' => 'PledgeBlock',
249 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
253 'pledge_start_date' => [
254 'name' => 'pledge_start_date',
255 'type' => CRM_Utils_Type
::T_STRING
,
256 'title' => ts('Pledge Start Date'),
257 'description' => ts('The date the first scheduled pledge occurs.'),
259 'size' => CRM_Utils_Type
::BIG
,
260 'where' => 'civicrm_pledge_block.pledge_start_date',
261 'table_name' => 'civicrm_pledge_block',
262 'entity' => 'PledgeBlock',
263 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
267 'is_pledge_start_date_visible' => [
268 'name' => 'is_pledge_start_date_visible',
269 'type' => CRM_Utils_Type
::T_BOOLEAN
,
270 'title' => ts('Show Recurring Donation Start Date?'),
271 'description' => ts('If true - recurring start date is shown.'),
273 'where' => 'civicrm_pledge_block.is_pledge_start_date_visible',
275 'table_name' => 'civicrm_pledge_block',
276 'entity' => 'PledgeBlock',
277 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
281 'is_pledge_start_date_editable' => [
282 'name' => 'is_pledge_start_date_editable',
283 'type' => CRM_Utils_Type
::T_BOOLEAN
,
284 'title' => ts('Allow Edits to Recurring Donation Start Date?'),
285 'description' => ts('If true - recurring start date is editable.'),
287 'where' => 'civicrm_pledge_block.is_pledge_start_date_editable',
289 'table_name' => 'civicrm_pledge_block',
290 'entity' => 'PledgeBlock',
291 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
296 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
298 return Civi
::$statics[__CLASS__
]['fields'];
302 * Return a mapping from field-name to the corresponding key (as used in fields()).
305 * Array(string $name => string $uniqueName).
307 public static function &fieldKeys() {
308 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
309 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
311 return Civi
::$statics[__CLASS__
]['fieldKeys'];
315 * Returns the names of this table
319 public static function getTableName() {
320 return self
::$_tableName;
324 * Returns if this table needs to be logged
328 public function getLog() {
333 * Returns the list of fields that can be imported
335 * @param bool $prefix
339 public static function &import($prefix = FALSE) {
340 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'pledge_block', $prefix, []);
345 * Returns the list of fields that can be exported
347 * @param bool $prefix
351 public static function &export($prefix = FALSE) {
352 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'pledge_block', $prefix, []);
357 * Returns the list of indices
359 * @param bool $localize
363 public static function indices($localize = TRUE) {
366 'name' => 'index_entity',
371 'localizable' => FALSE,
372 'sig' => 'civicrm_pledge_block::0::entity_table::entity_id',
375 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;