5 * @copyright CiviCRM LLC (c) 2004-2017
7 * Generated from xml/schema/CRM/Pledge/PledgeBlock.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:630f1a7378136b8cc3edcd82a96279d6)
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' => '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' => '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' => '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' => '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' => 'Is frequency interval exposed on the contribution form.',
191 'table_name' => 'civicrm_pledge_block',
192 'entity' => 'PledgeBlock',
193 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
197 'name' => 'max_reminders',
198 'type' => CRM_Utils_Type
::T_INT
,
199 'title' => ts('Maximum Number of Reminders'),
200 'description' => 'The maximum number of payment reminders to send for any given payment.',
202 'table_name' => 'civicrm_pledge_block',
203 'entity' => 'PledgeBlock',
204 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
207 'initial_reminder_day' => [
208 'name' => 'initial_reminder_day',
209 'type' => CRM_Utils_Type
::T_INT
,
210 'title' => ts('Initial Reminder Day'),
211 'description' => 'Send initial reminder this many days prior to the payment due date.',
213 'table_name' => 'civicrm_pledge_block',
214 'entity' => 'PledgeBlock',
215 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
218 'additional_reminder_day' => [
219 'name' => 'additional_reminder_day',
220 'type' => CRM_Utils_Type
::T_INT
,
221 'title' => ts('Additional Reminder Days'),
222 'description' => 'Send additional reminder this many days after last one sent, up to maximum number of reminders.',
224 'table_name' => 'civicrm_pledge_block',
225 'entity' => 'PledgeBlock',
226 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
229 'pledge_start_date' => [
230 'name' => 'pledge_start_date',
231 'type' => CRM_Utils_Type
::T_STRING
,
232 'title' => ts('Pledge Start Date'),
233 'description' => 'The date the first scheduled pledge occurs.',
235 'size' => CRM_Utils_Type
::BIG
,
236 'table_name' => 'civicrm_pledge_block',
237 'entity' => 'PledgeBlock',
238 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
241 'is_pledge_start_date_visible' => [
242 'name' => 'is_pledge_start_date_visible',
243 'type' => CRM_Utils_Type
::T_BOOLEAN
,
244 'title' => ts('Show Recurring Donation Start Date?'),
245 'description' => 'If true - recurring start date is shown.',
247 'table_name' => 'civicrm_pledge_block',
248 'entity' => 'PledgeBlock',
249 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
252 'is_pledge_start_date_editable' => [
253 'name' => 'is_pledge_start_date_editable',
254 'type' => CRM_Utils_Type
::T_BOOLEAN
,
255 'title' => ts('Allow Edits to Recurring Donation Start Date?'),
256 'description' => 'If true - recurring start date is editable.',
258 'table_name' => 'civicrm_pledge_block',
259 'entity' => 'PledgeBlock',
260 'bao' => 'CRM_Pledge_BAO_PledgeBlock',
264 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
266 return Civi
::$statics[__CLASS__
]['fields'];
270 * Return a mapping from field-name to the corresponding key (as used in fields()).
273 * Array(string $name => string $uniqueName).
275 public static function &fieldKeys() {
276 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
277 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
279 return Civi
::$statics[__CLASS__
]['fieldKeys'];
283 * Returns the names of this table
287 public static function getTableName() {
288 return self
::$_tableName;
292 * Returns if this table needs to be logged
296 public function getLog() {
301 * Returns the list of fields that can be imported
303 * @param bool $prefix
307 public static function &import($prefix = FALSE) {
308 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'pledge_block', $prefix, []);
313 * Returns the list of fields that can be exported
315 * @param bool $prefix
319 public static function &export($prefix = FALSE) {
320 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'pledge_block', $prefix, []);
325 * Returns the list of indices
327 * @param bool $localize
331 public static function indices($localize = TRUE) {
334 'name' => 'index_entity',
339 'localizable' => FALSE,
340 'sig' => 'civicrm_pledge_block::0::entity_table::entity_id',
343 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;