Merge pull request #17641 from MegaphoneJon/core-1590
[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:4a3012f88c67826cb4264a3340e908ec)
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 public static function getEntityTitle() {
108 return ts('Participant Status Types');
109 }
110
111 /**
112 * Returns all the column names of this table
113 *
114 * @return array
115 */
116 public static function &fields() {
117 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
118 Civi::$statics[__CLASS__]['fields'] = [
119 'id' => [
120 'name' => 'id',
121 'type' => CRM_Utils_Type::T_INT,
122 'title' => ts('Participant Status Type ID'),
123 'description' => ts('unique participant status type id'),
124 'required' => TRUE,
125 'where' => 'civicrm_participant_status_type.id',
126 'table_name' => 'civicrm_participant_status_type',
127 'entity' => 'ParticipantStatusType',
128 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
129 'localizable' => 0,
130 'add' => '3.0',
131 ],
132 'participant_status' => [
133 'name' => 'name',
134 'type' => CRM_Utils_Type::T_STRING,
135 'title' => ts('Participant Status'),
136 'description' => ts('non-localized name of the status type'),
137 'maxlength' => 64,
138 'size' => CRM_Utils_Type::BIG,
139 'import' => TRUE,
140 'where' => 'civicrm_participant_status_type.name',
141 'export' => TRUE,
142 'table_name' => 'civicrm_participant_status_type',
143 'entity' => 'ParticipantStatusType',
144 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
145 'localizable' => 0,
146 'add' => '3.0',
147 ],
148 'label' => [
149 'name' => 'label',
150 'type' => CRM_Utils_Type::T_STRING,
151 'title' => ts('Participant Status Label'),
152 'description' => ts('localized label for display of this status type'),
153 'maxlength' => 255,
154 'size' => CRM_Utils_Type::HUGE,
155 'where' => 'civicrm_participant_status_type.label',
156 'table_name' => 'civicrm_participant_status_type',
157 'entity' => 'ParticipantStatusType',
158 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
159 'localizable' => 1,
160 'add' => '3.0',
161 ],
162 'class' => [
163 'name' => 'class',
164 'type' => CRM_Utils_Type::T_STRING,
165 'title' => ts('Participant Status Class'),
166 'description' => ts('the general group of status type this one belongs to'),
167 'maxlength' => 8,
168 'size' => CRM_Utils_Type::EIGHT,
169 'where' => 'civicrm_participant_status_type.class',
170 'table_name' => 'civicrm_participant_status_type',
171 'entity' => 'ParticipantStatusType',
172 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
173 'localizable' => 0,
174 'html' => [
175 'type' => 'Select',
176 ],
177 'pseudoconstant' => [
178 'callback' => 'CRM_Event_PseudoConstant::participantStatusClassOptions',
179 ],
180 'add' => '3.0',
181 ],
182 'is_reserved' => [
183 'name' => 'is_reserved',
184 'type' => CRM_Utils_Type::T_BOOLEAN,
185 'title' => ts('Participant Status Is Reserved?>'),
186 'description' => ts('whether this is a status type required by the system'),
187 'where' => 'civicrm_participant_status_type.is_reserved',
188 'table_name' => 'civicrm_participant_status_type',
189 'entity' => 'ParticipantStatusType',
190 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
191 'localizable' => 0,
192 'add' => '3.0',
193 ],
194 'is_active' => [
195 'name' => 'is_active',
196 'type' => CRM_Utils_Type::T_BOOLEAN,
197 'title' => ts('Participant Status is Active'),
198 'description' => ts('whether this status type is active'),
199 'where' => 'civicrm_participant_status_type.is_active',
200 'default' => '1',
201 'table_name' => 'civicrm_participant_status_type',
202 'entity' => 'ParticipantStatusType',
203 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
204 'localizable' => 0,
205 'add' => '3.0',
206 ],
207 'is_counted' => [
208 'name' => 'is_counted',
209 'type' => CRM_Utils_Type::T_BOOLEAN,
210 'title' => ts('Participant Status Counts?'),
211 'description' => ts('whether this status type is counted against event size limit'),
212 'where' => 'civicrm_participant_status_type.is_counted',
213 'table_name' => 'civicrm_participant_status_type',
214 'entity' => 'ParticipantStatusType',
215 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
216 'localizable' => 0,
217 'add' => '3.0',
218 ],
219 'weight' => [
220 'name' => 'weight',
221 'type' => CRM_Utils_Type::T_INT,
222 'title' => ts('Order'),
223 'description' => ts('controls sort order'),
224 'required' => TRUE,
225 'where' => 'civicrm_participant_status_type.weight',
226 'table_name' => 'civicrm_participant_status_type',
227 'entity' => 'ParticipantStatusType',
228 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
229 'localizable' => 0,
230 'add' => '3.0',
231 ],
232 'visibility_id' => [
233 'name' => 'visibility_id',
234 'type' => CRM_Utils_Type::T_INT,
235 'title' => ts('Participant Status Visibility'),
236 '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'),
237 'where' => 'civicrm_participant_status_type.visibility_id',
238 'table_name' => 'civicrm_participant_status_type',
239 'entity' => 'ParticipantStatusType',
240 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
241 'localizable' => 0,
242 'html' => [
243 'type' => 'Select',
244 ],
245 'pseudoconstant' => [
246 'optionGroupName' => 'visibility',
247 'optionEditPath' => 'civicrm/admin/options/visibility',
248 ],
249 'add' => '3.0',
250 ],
251 ];
252 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
253 }
254 return Civi::$statics[__CLASS__]['fields'];
255 }
256
257 /**
258 * Return a mapping from field-name to the corresponding key (as used in fields()).
259 *
260 * @return array
261 * Array(string $name => string $uniqueName).
262 */
263 public static function &fieldKeys() {
264 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
265 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
266 }
267 return Civi::$statics[__CLASS__]['fieldKeys'];
268 }
269
270 /**
271 * Returns the names of this table
272 *
273 * @return string
274 */
275 public static function getTableName() {
276 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
277 }
278
279 /**
280 * Returns if this table needs to be logged
281 *
282 * @return bool
283 */
284 public function getLog() {
285 return self::$_log;
286 }
287
288 /**
289 * Returns the list of fields that can be imported
290 *
291 * @param bool $prefix
292 *
293 * @return array
294 */
295 public static function &import($prefix = FALSE) {
296 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'participant_status_type', $prefix, []);
297 return $r;
298 }
299
300 /**
301 * Returns the list of fields that can be exported
302 *
303 * @param bool $prefix
304 *
305 * @return array
306 */
307 public static function &export($prefix = FALSE) {
308 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'participant_status_type', $prefix, []);
309 return $r;
310 }
311
312 /**
313 * Returns the list of indices
314 *
315 * @param bool $localize
316 *
317 * @return array
318 */
319 public static function indices($localize = TRUE) {
320 $indices = [];
321 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
322 }
323
324 }