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