Merge pull request #22558 from eileenmcnaughton/coleman
[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:bb9ea5411d4ab4f767d891f2e0f20858)
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|null
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|null
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|null
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 'where' => 'civicrm_participant_status_type.is_reserved',
214 'table_name' => 'civicrm_participant_status_type',
215 'entity' => 'ParticipantStatusType',
216 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
217 'localizable' => 0,
218 'add' => '3.0',
219 ],
220 'is_active' => [
221 'name' => 'is_active',
222 'type' => CRM_Utils_Type::T_BOOLEAN,
223 'title' => ts('Participant Status is Active'),
224 'description' => ts('whether this status type is active'),
225 'where' => 'civicrm_participant_status_type.is_active',
226 'default' => '1',
227 'table_name' => 'civicrm_participant_status_type',
228 'entity' => 'ParticipantStatusType',
229 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
230 'localizable' => 0,
231 'add' => '3.0',
232 ],
233 'is_counted' => [
234 'name' => 'is_counted',
235 'type' => CRM_Utils_Type::T_BOOLEAN,
236 'title' => ts('Participant Status Counts?'),
237 'description' => ts('whether this status type is counted against event size limit'),
238 'where' => 'civicrm_participant_status_type.is_counted',
239 'table_name' => 'civicrm_participant_status_type',
240 'entity' => 'ParticipantStatusType',
241 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
242 'localizable' => 0,
243 'add' => '3.0',
244 ],
245 'weight' => [
246 'name' => 'weight',
247 'type' => CRM_Utils_Type::T_INT,
248 'title' => ts('Order'),
249 'description' => ts('controls sort order'),
250 'required' => TRUE,
251 'where' => 'civicrm_participant_status_type.weight',
252 'table_name' => 'civicrm_participant_status_type',
253 'entity' => 'ParticipantStatusType',
254 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
255 'localizable' => 0,
256 'add' => '3.0',
257 ],
258 'visibility_id' => [
259 'name' => 'visibility_id',
260 'type' => CRM_Utils_Type::T_INT,
261 'title' => ts('Participant Status Visibility'),
262 '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'),
263 'where' => 'civicrm_participant_status_type.visibility_id',
264 'table_name' => 'civicrm_participant_status_type',
265 'entity' => 'ParticipantStatusType',
266 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
267 'localizable' => 0,
268 'html' => [
269 'type' => 'Select',
270 ],
271 'pseudoconstant' => [
272 'optionGroupName' => 'visibility',
273 'optionEditPath' => 'civicrm/admin/options/visibility',
274 ],
275 'add' => '3.0',
276 ],
277 ];
278 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
279 }
280 return Civi::$statics[__CLASS__]['fields'];
281 }
282
283 /**
284 * Return a mapping from field-name to the corresponding key (as used in fields()).
285 *
286 * @return array
287 * Array(string $name => string $uniqueName).
288 */
289 public static function &fieldKeys() {
290 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
291 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
292 }
293 return Civi::$statics[__CLASS__]['fieldKeys'];
294 }
295
296 /**
297 * Returns the names of this table
298 *
299 * @return string
300 */
301 public static function getTableName() {
302 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
303 }
304
305 /**
306 * Returns if this table needs to be logged
307 *
308 * @return bool
309 */
310 public function getLog() {
311 return self::$_log;
312 }
313
314 /**
315 * Returns the list of fields that can be imported
316 *
317 * @param bool $prefix
318 *
319 * @return array
320 */
321 public static function &import($prefix = FALSE) {
322 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'participant_status_type', $prefix, []);
323 return $r;
324 }
325
326 /**
327 * Returns the list of fields that can be exported
328 *
329 * @param bool $prefix
330 *
331 * @return array
332 */
333 public static function &export($prefix = FALSE) {
334 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'participant_status_type', $prefix, []);
335 return $r;
336 }
337
338 /**
339 * Returns the list of indices
340 *
341 * @param bool $localize
342 *
343 * @return array
344 */
345 public static function indices($localize = TRUE) {
346 $indices = [];
347 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
348 }
349
350 }