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:2ee09d20ee73675e8c28c7aa9207f67d)
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';
18 const COMPONENT
= 'CiviPledge';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_pledge_block';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = TRUE;
42 * physical tablename for entity being joined to pledge, e.g. civicrm_contact
49 * FK to entity table specified in entity_table column.
56 * Delimited list of supported frequency units
60 public $pledge_frequency_unit;
63 * Is frequency interval exposed on the contribution form.
67 public $is_pledge_interval;
70 * The maximum number of payment reminders to send for any given payment.
74 public $max_reminders;
77 * Send initial reminder this many days prior to the payment due date.
81 public $initial_reminder_day;
84 * Send additional reminder this many days after last one sent, up to maximum number of reminders.
88 public $additional_reminder_day;
91 * The date the first scheduled pledge occurs.
95 public $pledge_start_date;
98 * If true - recurring start date is shown.
102 public $is_pledge_start_date_visible;
105 * If true - recurring start date is editable.
109 public $is_pledge_start_date_editable;
114 public function __construct() {
115 $this->__table
= 'civicrm_pledge_block';
116 parent
::__construct();
120 * Returns localized title of this entity.
122 * @param bool $plural
123 * Whether to return the plural version of the title.
125 public static function getEntityTitle($plural = FALSE) {
126 return $plural ?
ts('Pledge Blocks') : ts('Pledge Block');
130 * Returns foreign keys and entity references.
133 * [CRM_Core_Reference_Interface]
135 public static function getReferenceColumns() {
136 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
137 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
138 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Dynamic(self
::getTableName(), 'entity_id', NULL, 'id', 'entity_table');
139 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
141 return Civi
::$statics[__CLASS__
]['links'];
145 * Returns all the column names of this table
149 public static function &fields() {
150 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
151 Civi
::$statics[__CLASS__
]['fields'] = [
154 'type' => CRM_Utils_Type
::T_INT
,
155 'title' => ts('Pledge Block ID'),
156 'description' => ts('Pledge ID'),
158 'where' => 'civicrm_pledge_block.id',
159 'table_name' => 'civicrm_pledge_block',
160 'entity' => 'PledgeBlock',
161 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
170 'name' => 'entity_table',
171 'type' => CRM_Utils_Type
::T_STRING
,
172 'title' => ts('Entity Table'),
173 'description' => ts('physical tablename for entity being joined to pledge, e.g. civicrm_contact'),
175 'size' => CRM_Utils_Type
::BIG
,
176 'where' => 'civicrm_pledge_block.entity_table',
177 'table_name' => 'civicrm_pledge_block',
178 'entity' => 'PledgeBlock',
179 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
184 'name' => 'entity_id',
185 'type' => CRM_Utils_Type
::T_INT
,
186 'title' => ts('Entity ID'),
187 'description' => ts('FK to entity table specified in entity_table column.'),
189 'where' => 'civicrm_pledge_block.entity_id',
190 'table_name' => 'civicrm_pledge_block',
191 'entity' => 'PledgeBlock',
192 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
196 'pledge_frequency_unit' => [
197 'name' => 'pledge_frequency_unit',
198 'type' => CRM_Utils_Type
::T_STRING
,
199 'title' => ts('Pledge Frequency Unit'),
200 'description' => ts('Delimited list of supported frequency units'),
202 'size' => CRM_Utils_Type
::HUGE
,
203 'where' => 'civicrm_pledge_block.pledge_frequency_unit',
204 'table_name' => 'civicrm_pledge_block',
205 'entity' => 'PledgeBlock',
206 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
208 'serialize' => self
::SERIALIZE_SEPARATOR_TRIMMED
,
211 'is_pledge_interval' => [
212 'name' => 'is_pledge_interval',
213 'type' => CRM_Utils_Type
::T_BOOLEAN
,
214 'title' => ts('Expose Frequency Interval?'),
215 'description' => ts('Is frequency interval exposed on the contribution form.'),
216 'where' => 'civicrm_pledge_block.is_pledge_interval',
218 'table_name' => 'civicrm_pledge_block',
219 'entity' => 'PledgeBlock',
220 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
225 'name' => 'max_reminders',
226 'type' => CRM_Utils_Type
::T_INT
,
227 'title' => ts('Maximum Number of Reminders'),
228 'description' => ts('The maximum number of payment reminders to send for any given payment.'),
229 'where' => 'civicrm_pledge_block.max_reminders',
231 'table_name' => 'civicrm_pledge_block',
232 'entity' => 'PledgeBlock',
233 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
237 'initial_reminder_day' => [
238 'name' => 'initial_reminder_day',
239 'type' => CRM_Utils_Type
::T_INT
,
240 'title' => ts('Initial Reminder Day'),
241 'description' => ts('Send initial reminder this many days prior to the payment due date.'),
242 'where' => 'civicrm_pledge_block.initial_reminder_day',
244 'table_name' => 'civicrm_pledge_block',
245 'entity' => 'PledgeBlock',
246 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
250 'additional_reminder_day' => [
251 'name' => 'additional_reminder_day',
252 'type' => CRM_Utils_Type
::T_INT
,
253 'title' => ts('Additional Reminder Days'),
254 'description' => ts('Send additional reminder this many days after last one sent, up to maximum number of reminders.'),
255 'where' => 'civicrm_pledge_block.additional_reminder_day',
257 'table_name' => 'civicrm_pledge_block',
258 'entity' => 'PledgeBlock',
259 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
263 'pledge_start_date' => [
264 'name' => 'pledge_start_date',
265 'type' => CRM_Utils_Type
::T_STRING
,
266 'title' => ts('Pledge Start Date'),
267 'description' => ts('The date the first scheduled pledge occurs.'),
269 'size' => CRM_Utils_Type
::BIG
,
270 'where' => 'civicrm_pledge_block.pledge_start_date',
271 'table_name' => 'civicrm_pledge_block',
272 'entity' => 'PledgeBlock',
273 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
277 'is_pledge_start_date_visible' => [
278 'name' => 'is_pledge_start_date_visible',
279 'type' => CRM_Utils_Type
::T_BOOLEAN
,
280 'title' => ts('Show Recurring Donation Start Date?'),
281 'description' => ts('If true - recurring start date is shown.'),
283 'where' => 'civicrm_pledge_block.is_pledge_start_date_visible',
285 'table_name' => 'civicrm_pledge_block',
286 'entity' => 'PledgeBlock',
287 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
291 'is_pledge_start_date_editable' => [
292 'name' => 'is_pledge_start_date_editable',
293 'type' => CRM_Utils_Type
::T_BOOLEAN
,
294 'title' => ts('Allow Edits to Recurring Donation Start Date?'),
295 'description' => ts('If true - recurring start date is editable.'),
297 'where' => 'civicrm_pledge_block.is_pledge_start_date_editable',
299 'table_name' => 'civicrm_pledge_block',
300 'entity' => 'PledgeBlock',
301 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
306 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
308 return Civi
::$statics[__CLASS__
]['fields'];
312 * Return a mapping from field-name to the corresponding key (as used in fields()).
315 * Array(string $name => string $uniqueName).
317 public static function &fieldKeys() {
318 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
319 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
321 return Civi
::$statics[__CLASS__
]['fieldKeys'];
325 * Returns the names of this table
329 public static function getTableName() {
330 return self
::$_tableName;
334 * Returns if this table needs to be logged
338 public function getLog() {
343 * Returns the list of fields that can be imported
345 * @param bool $prefix
349 public static function &import($prefix = FALSE) {
350 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'pledge_block', $prefix, []);
355 * Returns the list of fields that can be exported
357 * @param bool $prefix
361 public static function &export($prefix = FALSE) {
362 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'pledge_block', $prefix, []);
367 * Returns the list of indices
369 * @param bool $localize
373 public static function indices($localize = TRUE) {
376 'name' => 'index_entity',
381 'localizable' => FALSE,
382 'sig' => 'civicrm_pledge_block::0::entity_table::entity_id',
385 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;