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