CodeGen - Add EXT and TABLE_ADDED to each DAO file
[civicrm-core.git] / CRM / Event / DAO / ParticipantStatusType.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Event/ParticipantStatusType.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:ede2497e706ee17bb6dce92b72a2c535)
10 */
11
12 /**
13 * Database access object for the ParticipantStatusType entity.
14 */
15 class CRM_Event_DAO_ParticipantStatusType extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_participant_status_type';
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 * unique participant status type id
33 *
34 * @var int
35 */
36 public $id;
37
38 /**
39 * non-localized name of the status type
40 *
41 * @var string
42 */
43 public $name;
44
45 /**
46 * localized label for display of this status type
47 *
48 * @var string
49 */
50 public $label;
51
52 /**
53 * the general group of status type this one belongs to
54 *
55 * @var string
56 */
57 public $class;
58
59 /**
60 * whether this is a status type required by the system
61 *
62 * @var bool
63 */
64 public $is_reserved;
65
66 /**
67 * whether this status type is active
68 *
69 * @var bool
70 */
71 public $is_active;
72
73 /**
74 * whether this status type is counted against event size limit
75 *
76 * @var bool
77 */
78 public $is_counted;
79
80 /**
81 * controls sort order
82 *
83 * @var int
84 */
85 public $weight;
86
87 /**
88 * whether the status type is visible to the public, an implicit foreign key to option_value.value related to the `visibility` option_group
89 *
90 * @var int
91 */
92 public $visibility_id;
93
94 /**
95 * Class constructor.
96 */
97 public function __construct() {
98 $this->__table = 'civicrm_participant_status_type';
99 parent::__construct();
100 }
101
102 /**
103 * Returns localized title of this entity.
104 */
105 public static function getEntityTitle() {
106 return ts('Participant Status Types');
107 }
108
109 /**
110 * Returns all the column names of this table
111 *
112 * @return array
113 */
114 public static function &fields() {
115 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
116 Civi::$statics[__CLASS__]['fields'] = [
117 'id' => [
118 'name' => 'id',
119 'type' => CRM_Utils_Type::T_INT,
120 'title' => ts('Participant Status Type ID'),
121 'description' => ts('unique participant status type id'),
122 'required' => TRUE,
123 'where' => 'civicrm_participant_status_type.id',
124 'table_name' => 'civicrm_participant_status_type',
125 'entity' => 'ParticipantStatusType',
126 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
127 'localizable' => 0,
128 'add' => '3.0',
129 ],
130 'participant_status' => [
131 'name' => 'name',
132 'type' => CRM_Utils_Type::T_STRING,
133 'title' => ts('Participant Status'),
134 'description' => ts('non-localized name of the status type'),
135 'maxlength' => 64,
136 'size' => CRM_Utils_Type::BIG,
137 'import' => TRUE,
138 'where' => 'civicrm_participant_status_type.name',
139 'export' => TRUE,
140 'table_name' => 'civicrm_participant_status_type',
141 'entity' => 'ParticipantStatusType',
142 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
143 'localizable' => 0,
144 'add' => '3.0',
145 ],
146 'label' => [
147 'name' => 'label',
148 'type' => CRM_Utils_Type::T_STRING,
149 'title' => ts('Participant Status Label'),
150 'description' => ts('localized label for display of this status type'),
151 'maxlength' => 255,
152 'size' => CRM_Utils_Type::HUGE,
153 'where' => 'civicrm_participant_status_type.label',
154 'table_name' => 'civicrm_participant_status_type',
155 'entity' => 'ParticipantStatusType',
156 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
157 'localizable' => 1,
158 'add' => '3.0',
159 ],
160 'class' => [
161 'name' => 'class',
162 'type' => CRM_Utils_Type::T_STRING,
163 'title' => ts('Participant Status Class'),
164 'description' => ts('the general group of status type this one belongs to'),
165 'maxlength' => 8,
166 'size' => CRM_Utils_Type::EIGHT,
167 'where' => 'civicrm_participant_status_type.class',
168 'table_name' => 'civicrm_participant_status_type',
169 'entity' => 'ParticipantStatusType',
170 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
171 'localizable' => 0,
172 'html' => [
173 'type' => 'Select',
174 ],
175 'pseudoconstant' => [
176 'callback' => 'CRM_Event_PseudoConstant::participantStatusClassOptions',
177 ],
178 'add' => '3.0',
179 ],
180 'is_reserved' => [
181 'name' => 'is_reserved',
182 'type' => CRM_Utils_Type::T_BOOLEAN,
183 'title' => ts('Participant Status Is Reserved?>'),
184 'description' => ts('whether this is a status type required by the system'),
185 'where' => 'civicrm_participant_status_type.is_reserved',
186 'table_name' => 'civicrm_participant_status_type',
187 'entity' => 'ParticipantStatusType',
188 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
189 'localizable' => 0,
190 'add' => '3.0',
191 ],
192 'is_active' => [
193 'name' => 'is_active',
194 'type' => CRM_Utils_Type::T_BOOLEAN,
195 'title' => ts('Participant Status is Active'),
196 'description' => ts('whether this status type is active'),
197 'where' => 'civicrm_participant_status_type.is_active',
198 'default' => '1',
199 'table_name' => 'civicrm_participant_status_type',
200 'entity' => 'ParticipantStatusType',
201 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
202 'localizable' => 0,
203 'add' => '3.0',
204 ],
205 'is_counted' => [
206 'name' => 'is_counted',
207 'type' => CRM_Utils_Type::T_BOOLEAN,
208 'title' => ts('Participant Status Counts?'),
209 'description' => ts('whether this status type is counted against event size limit'),
210 'where' => 'civicrm_participant_status_type.is_counted',
211 'table_name' => 'civicrm_participant_status_type',
212 'entity' => 'ParticipantStatusType',
213 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
214 'localizable' => 0,
215 'add' => '3.0',
216 ],
217 'weight' => [
218 'name' => 'weight',
219 'type' => CRM_Utils_Type::T_INT,
220 'title' => ts('Order'),
221 'description' => ts('controls sort order'),
222 'required' => TRUE,
223 'where' => 'civicrm_participant_status_type.weight',
224 'table_name' => 'civicrm_participant_status_type',
225 'entity' => 'ParticipantStatusType',
226 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
227 'localizable' => 0,
228 'add' => '3.0',
229 ],
230 'visibility_id' => [
231 'name' => 'visibility_id',
232 'type' => CRM_Utils_Type::T_INT,
233 'title' => ts('Participant Status Visibility'),
234 'description' => ts('whether the status type is visible to the public, an implicit foreign key to option_value.value related to the `visibility` option_group'),
235 'where' => 'civicrm_participant_status_type.visibility_id',
236 'table_name' => 'civicrm_participant_status_type',
237 'entity' => 'ParticipantStatusType',
238 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
239 'localizable' => 0,
240 'html' => [
241 'type' => 'Select',
242 ],
243 'pseudoconstant' => [
244 'optionGroupName' => 'visibility',
245 'optionEditPath' => 'civicrm/admin/options/visibility',
246 ],
247 'add' => '3.0',
248 ],
249 ];
250 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
251 }
252 return Civi::$statics[__CLASS__]['fields'];
253 }
254
255 /**
256 * Return a mapping from field-name to the corresponding key (as used in fields()).
257 *
258 * @return array
259 * Array(string $name => string $uniqueName).
260 */
261 public static function &fieldKeys() {
262 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
263 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
264 }
265 return Civi::$statics[__CLASS__]['fieldKeys'];
266 }
267
268 /**
269 * Returns the names of this table
270 *
271 * @return string
272 */
273 public static function getTableName() {
274 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
275 }
276
277 /**
278 * Returns if this table needs to be logged
279 *
280 * @return bool
281 */
282 public function getLog() {
283 return self::$_log;
284 }
285
286 /**
287 * Returns the list of fields that can be imported
288 *
289 * @param bool $prefix
290 *
291 * @return array
292 */
293 public static function &import($prefix = FALSE) {
294 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'participant_status_type', $prefix, []);
295 return $r;
296 }
297
298 /**
299 * Returns the list of fields that can be exported
300 *
301 * @param bool $prefix
302 *
303 * @return array
304 */
305 public static function &export($prefix = FALSE) {
306 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'participant_status_type', $prefix, []);
307 return $r;
308 }
309
310 /**
311 * Returns the list of indices
312 *
313 * @param bool $localize
314 *
315 * @return array
316 */
317 public static function indices($localize = TRUE) {
318 $indices = [];
319 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
320 }
321
322 }