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