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