Merge pull request #13010 from jitendrapurohit/core-474
[civicrm-core.git] / CRM / Event / DAO / ParticipantStatusType.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2018
6 *
7 * Generated from xml/schema/CRM/Event/ParticipantStatusType.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:614f4f6813728d18eb5ccd003c6d3d33)
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 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 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 'table_name' => 'civicrm_participant_status_type',
117 'entity' => 'ParticipantStatusType',
118 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
119 'localizable' => 0,
120 ],
121 'participant_status' => [
122 'name' => 'name',
123 'type' => CRM_Utils_Type::T_STRING,
124 'title' => ts('Participant Status'),
125 'description' => ts('non-localized name of the status type'),
126 'maxlength' => 64,
127 'size' => CRM_Utils_Type::BIG,
128 'import' => TRUE,
129 'where' => 'civicrm_participant_status_type.name',
130 'headerPattern' => '',
131 'dataPattern' => '',
132 'export' => TRUE,
133 'table_name' => 'civicrm_participant_status_type',
134 'entity' => 'ParticipantStatusType',
135 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
136 'localizable' => 0,
137 ],
138 'label' => [
139 'name' => 'label',
140 'type' => CRM_Utils_Type::T_STRING,
141 'title' => ts('Participant Status Label'),
142 'description' => ts('localized label for display of this status type'),
143 'maxlength' => 255,
144 'size' => CRM_Utils_Type::HUGE,
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 'table_name' => 'civicrm_participant_status_type',
158 'entity' => 'ParticipantStatusType',
159 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
160 'localizable' => 0,
161 'html' => [
162 'type' => 'Select',
163 ],
164 'pseudoconstant' => [
165 'callback' => 'CRM_Event_PseudoConstant::participantStatusClassOptions',
166 ]
167 ],
168 'is_reserved' => [
169 'name' => 'is_reserved',
170 'type' => CRM_Utils_Type::T_BOOLEAN,
171 'title' => ts('Participant Status Is Reserved?>'),
172 'description' => ts('whether this is a status type required by the system'),
173 'table_name' => 'civicrm_participant_status_type',
174 'entity' => 'ParticipantStatusType',
175 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
176 'localizable' => 0,
177 ],
178 'is_active' => [
179 'name' => 'is_active',
180 'type' => CRM_Utils_Type::T_BOOLEAN,
181 'title' => ts('Participant Status is Active'),
182 'description' => ts('whether this status type is active'),
183 'default' => '1',
184 'table_name' => 'civicrm_participant_status_type',
185 'entity' => 'ParticipantStatusType',
186 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
187 'localizable' => 0,
188 ],
189 'is_counted' => [
190 'name' => 'is_counted',
191 'type' => CRM_Utils_Type::T_BOOLEAN,
192 'title' => ts('Participant Status Counts?'),
193 'description' => ts('whether this status type is counted against event size limit'),
194 'table_name' => 'civicrm_participant_status_type',
195 'entity' => 'ParticipantStatusType',
196 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
197 'localizable' => 0,
198 ],
199 'weight' => [
200 'name' => 'weight',
201 'type' => CRM_Utils_Type::T_INT,
202 'title' => ts('Order'),
203 'description' => ts('controls sort order'),
204 'required' => TRUE,
205 'table_name' => 'civicrm_participant_status_type',
206 'entity' => 'ParticipantStatusType',
207 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
208 'localizable' => 0,
209 ],
210 'visibility_id' => [
211 'name' => 'visibility_id',
212 'type' => CRM_Utils_Type::T_INT,
213 'title' => ts('Participant Status Visibility'),
214 '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'),
215 'table_name' => 'civicrm_participant_status_type',
216 'entity' => 'ParticipantStatusType',
217 'bao' => 'CRM_Event_BAO_ParticipantStatusType',
218 'localizable' => 0,
219 'html' => [
220 'type' => 'Select',
221 ],
222 'pseudoconstant' => [
223 'optionGroupName' => 'visibility',
224 'optionEditPath' => 'civicrm/admin/options/visibility',
225 ]
226 ],
227 ];
228 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
229 }
230 return Civi::$statics[__CLASS__]['fields'];
231 }
232
233 /**
234 * Return a mapping from field-name to the corresponding key (as used in fields()).
235 *
236 * @return array
237 * Array(string $name => string $uniqueName).
238 */
239 public static function &fieldKeys() {
240 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
241 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
242 }
243 return Civi::$statics[__CLASS__]['fieldKeys'];
244 }
245
246 /**
247 * Returns the names of this table
248 *
249 * @return string
250 */
251 public static function getTableName() {
252 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
253 }
254
255 /**
256 * Returns if this table needs to be logged
257 *
258 * @return bool
259 */
260 public function getLog() {
261 return self::$_log;
262 }
263
264 /**
265 * Returns the list of fields that can be imported
266 *
267 * @param bool $prefix
268 *
269 * @return array
270 */
271 public static function &import($prefix = FALSE) {
272 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'participant_status_type', $prefix, []);
273 return $r;
274 }
275
276 /**
277 * Returns the list of fields that can be exported
278 *
279 * @param bool $prefix
280 *
281 * @return array
282 */
283 public static function &export($prefix = FALSE) {
284 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'participant_status_type', $prefix, []);
285 return $r;
286 }
287
288 /**
289 * Returns the list of indices
290 *
291 * @param bool $localize
292 *
293 * @return array
294 */
295 public static function indices($localize = TRUE) {
296 $indices = [];
297 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
298 }
299
300 }