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