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