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