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