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