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