Merge pull request #22992 from eileenmcnaughton/billingnot
[civicrm-core.git] / CRM / Core / DAO / RecurringEntity.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
ca5cec67 5 * @copyright CiviCRM LLC https://civicrm.org/licensing
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Core/RecurringEntity.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
28979d65 9 * (GenCodeChecksum:d8ff65b4009b67e8619f6f904c1b501d)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the RecurringEntity entity.
f41f0342 14 */
e501603b 15class CRM_Core_DAO_RecurringEntity extends CRM_Core_DAO {
929a1c14
CW
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '4.6';
c3fc2621 18
e501603b 19 /**
f41f0342 20 * Static instance to hold the table name.
e501603b
TO
21 *
22 * @var string
23 */
fa45b5b9 24 public static $_tableName = 'civicrm_recurring_entity';
c3fc2621 25
e501603b 26 /**
f41f0342 27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 28 *
c3fc2621 29 * @var bool
e501603b 30 */
fa45b5b9 31 public static $_log = TRUE;
c3fc2621 32
e501603b 33 /**
28979d65
CW
34 * @var int|string|null
35 * (SQL type: int unsigned)
36 * Note that values will be retrieved from the database as a string.
e501603b
TO
37 */
38 public $id;
c3fc2621 39
e501603b
TO
40 /**
41 * Recurring Entity Parent ID
42 *
28979d65
CW
43 * @var int|string
44 * (SQL type: int unsigned)
45 * Note that values will be retrieved from the database as a string.
e501603b
TO
46 */
47 public $parent_id;
c3fc2621 48
e501603b
TO
49 /**
50 * Recurring Entity Child ID
51 *
28979d65
CW
52 * @var int|string|null
53 * (SQL type: int unsigned)
54 * Note that values will be retrieved from the database as a string.
e501603b
TO
55 */
56 public $entity_id;
c3fc2621 57
e501603b
TO
58 /**
59 * Physical tablename for entity, e.g. civicrm_event
60 *
61 * @var string
28979d65
CW
62 * (SQL type: varchar(64))
63 * Note that values will be retrieved from the database as a string.
e501603b
TO
64 */
65 public $entity_table;
c3fc2621 66
e501603b
TO
67 /**
68 * 1-this entity, 2-this and the following entities, 3-all the entities
69 *
28979d65
CW
70 * @var bool|string
71 * (SQL type: tinyint)
72 * Note that values will be retrieved from the database as a string.
e501603b
TO
73 */
74 public $mode;
c3fc2621 75
e501603b 76 /**
f41f0342 77 * Class constructor.
e501603b 78 */
c3fc2621 79 public function __construct() {
e501603b
TO
80 $this->__table = 'civicrm_recurring_entity';
81 parent::__construct();
82 }
c3fc2621 83
449c4e6b
CW
84 /**
85 * Returns localized title of this entity.
7b66c3b5
AH
86 *
87 * @param bool $plural
88 * Whether to return the plural version of the title.
449c4e6b 89 */
7b66c3b5
AH
90 public static function getEntityTitle($plural = FALSE) {
91 return $plural ? ts('Recurring Entities') : ts('Recurring Entity');
449c4e6b
CW
92 }
93
e501603b
TO
94 /**
95 * Returns all the column names of this table
96 *
97 * @return array
98 */
c3fc2621 99 public static function &fields() {
346aaaba 100 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
101 Civi::$statics[__CLASS__]['fields'] = [
102 'id' => [
e501603b
TO
103 'name' => 'id',
104 'type' => CRM_Utils_Type::T_INT,
c3fc2621
CW
105 'title' => ts('ID'),
106 'required' => TRUE,
a36434b9 107 'where' => 'civicrm_recurring_entity.id',
522a26c9 108 'table_name' => 'civicrm_recurring_entity',
109 'entity' => 'RecurringEntity',
110 'bao' => 'CRM_Core_BAO_RecurringEntity',
6a7e5e5d 111 'localizable' => 0,
2cbbebe8
A
112 'html' => [
113 'type' => 'Number',
114 ],
1fe423d6 115 'readonly' => TRUE,
a9d0587b 116 'add' => '4.6',
c3fc2621
CW
117 ],
118 'parent_id' => [
e501603b
TO
119 'name' => 'parent_id',
120 'type' => CRM_Utils_Type::T_INT,
c3fc2621 121 'title' => ts('Parent ID'),
215b423e 122 'description' => ts('Recurring Entity Parent ID'),
c3fc2621 123 'required' => TRUE,
a36434b9 124 'where' => 'civicrm_recurring_entity.parent_id',
522a26c9 125 'table_name' => 'civicrm_recurring_entity',
126 'entity' => 'RecurringEntity',
127 'bao' => 'CRM_Core_BAO_RecurringEntity',
6a7e5e5d 128 'localizable' => 0,
a9d0587b 129 'add' => '4.6',
c3fc2621
CW
130 ],
131 'entity_id' => [
e501603b
TO
132 'name' => 'entity_id',
133 'type' => CRM_Utils_Type::T_INT,
c3fc2621 134 'title' => ts('Entity ID'),
215b423e 135 'description' => ts('Recurring Entity Child ID'),
a36434b9 136 'where' => 'civicrm_recurring_entity.entity_id',
522a26c9 137 'table_name' => 'civicrm_recurring_entity',
138 'entity' => 'RecurringEntity',
139 'bao' => 'CRM_Core_BAO_RecurringEntity',
6a7e5e5d 140 'localizable' => 0,
a9d0587b 141 'add' => '4.6',
c3fc2621
CW
142 ],
143 'entity_table' => [
e501603b
TO
144 'name' => 'entity_table',
145 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 146 'title' => ts('Entity Table'),
215b423e 147 'description' => ts('Physical tablename for entity, e.g. civicrm_event'),
c3fc2621 148 'required' => TRUE,
e501603b
TO
149 'maxlength' => 64,
150 'size' => CRM_Utils_Type::BIG,
a36434b9 151 'where' => 'civicrm_recurring_entity.entity_table',
522a26c9 152 'table_name' => 'civicrm_recurring_entity',
153 'entity' => 'RecurringEntity',
154 'bao' => 'CRM_Core_BAO_RecurringEntity',
6a7e5e5d 155 'localizable' => 0,
a9d0587b 156 'add' => '4.6',
c3fc2621
CW
157 ],
158 'mode' => [
e501603b
TO
159 'name' => 'mode',
160 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 161 'title' => ts('Cascade Type'),
215b423e 162 'description' => ts('1-this entity, 2-this and the following entities, 3-all the entities'),
c3fc2621 163 'required' => TRUE,
a36434b9 164 'where' => 'civicrm_recurring_entity.mode',
e501603b 165 'default' => '1',
522a26c9 166 'table_name' => 'civicrm_recurring_entity',
167 'entity' => 'RecurringEntity',
168 'bao' => 'CRM_Core_BAO_RecurringEntity',
6a7e5e5d 169 'localizable' => 0,
a9d0587b 170 'add' => '4.6',
c3fc2621
CW
171 ],
172 ];
346aaaba 173 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 174 }
346aaaba 175 return Civi::$statics[__CLASS__]['fields'];
e501603b 176 }
c3fc2621 177
e501603b 178 /**
bd8e0b14 179 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
180 *
181 * @return array
bd8e0b14 182 * Array(string $name => string $uniqueName).
e501603b 183 */
c3fc2621 184 public static function &fieldKeys() {
bd8e0b14
TO
185 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
186 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 187 }
bd8e0b14 188 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 189 }
c3fc2621 190
e501603b
TO
191 /**
192 * Returns the names of this table
193 *
194 * @return string
195 */
c3fc2621 196 public static function getTableName() {
e501603b
TO
197 return self::$_tableName;
198 }
c3fc2621 199
e501603b
TO
200 /**
201 * Returns if this table needs to be logged
202 *
c3fc2621 203 * @return bool
e501603b 204 */
c3fc2621 205 public function getLog() {
e501603b
TO
206 return self::$_log;
207 }
c3fc2621 208
e501603b
TO
209 /**
210 * Returns the list of fields that can be imported
211 *
212 * @param bool $prefix
213 *
214 * @return array
215 */
c3fc2621
CW
216 public static function &import($prefix = FALSE) {
217 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'recurring_entity', $prefix, []);
60808919 218 return $r;
e501603b 219 }
c3fc2621 220
e501603b
TO
221 /**
222 * Returns the list of fields that can be exported
223 *
224 * @param bool $prefix
225 *
226 * @return array
227 */
c3fc2621
CW
228 public static function &export($prefix = FALSE) {
229 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'recurring_entity', $prefix, []);
60808919 230 return $r;
e501603b 231 }
c3fc2621 232
e7a6b91a
AS
233 /**
234 * Returns the list of indices
c3fc2621
CW
235 *
236 * @param bool $localize
237 *
238 * @return array
e7a6b91a
AS
239 */
240 public static function indices($localize = TRUE) {
c3fc2621 241 $indices = [];
e7a6b91a
AS
242 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
243 }
c3fc2621 244
e501603b 245}