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