Merge pull request #8881 from liedekef/master
[civicrm-core.git] / CRM / Event / DAO / ParticipantStatusType.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
30 *
31 * Generated from xml/schema/CRM/Event/ParticipantStatusType.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:c129b855ca83f4e0e659f57936b92799)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Event_DAO_ParticipantStatusType extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_participant_status_type';
44 /**
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
47 *
48 * @var boolean
49 */
50 static $_log = true;
51 /**
52 * unique participant status type id
53 *
54 * @var int unsigned
55 */
56 public $id;
57 /**
58 * non-localized name of the status type
59 *
60 * @var string
61 */
62 public $name;
63 /**
64 * localized label for display of this status type
65 *
66 * @var string
67 */
68 public $label;
69 /**
70 * the general group of status type this one belongs to
71 *
72 * @var string
73 */
74 public $class;
75 /**
76 * whether this is a status type required by the system
77 *
78 * @var boolean
79 */
80 public $is_reserved;
81 /**
82 * whether this status type is active
83 *
84 * @var boolean
85 */
86 public $is_active;
87 /**
88 * whether this status type is counted against event size limit
89 *
90 * @var boolean
91 */
92 public $is_counted;
93 /**
94 * controls sort order
95 *
96 * @var int unsigned
97 */
98 public $weight;
99 /**
100 * whether the status type is visible to the public, an implicit foreign key to option_value.value related to the `visibility` option_group
101 *
102 * @var int unsigned
103 */
104 public $visibility_id;
105 /**
106 * class constructor
107 *
108 * @return civicrm_participant_status_type
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 ) ,
129 'participant_status' => array(
130 'name' => 'name',
131 'type' => CRM_Utils_Type::T_STRING,
132 'title' => ts('Participant Status') ,
133 'description' => 'non-localized name of the status type',
134 'maxlength' => 64,
135 'size' => CRM_Utils_Type::BIG,
136 'import' => true,
137 'where' => 'civicrm_participant_status_type.name',
138 'headerPattern' => '',
139 'dataPattern' => '',
140 'export' => true,
141 ) ,
142 'label' => array(
143 'name' => 'label',
144 'type' => CRM_Utils_Type::T_STRING,
145 'title' => ts('Participant Status Label') ,
146 'description' => 'localized label for display of this status type',
147 'maxlength' => 255,
148 'size' => CRM_Utils_Type::HUGE,
149 ) ,
150 'class' => array(
151 'name' => 'class',
152 'type' => CRM_Utils_Type::T_STRING,
153 'title' => ts('Participant Status Class') ,
154 'description' => 'the general group of status type this one belongs to',
155 'maxlength' => 8,
156 'size' => CRM_Utils_Type::EIGHT,
157 'html' => array(
158 'type' => 'Select',
159 ) ,
160 'pseudoconstant' => array(
161 'callback' => 'CRM_Event_PseudoConstant::participantStatusClassOptions',
162 )
163 ) ,
164 'is_reserved' => array(
165 'name' => 'is_reserved',
166 'type' => CRM_Utils_Type::T_BOOLEAN,
167 'title' => ts('Participant Status Is Reserved?>') ,
168 'description' => 'whether this is a status type required by the system',
169 ) ,
170 'is_active' => array(
171 'name' => 'is_active',
172 'type' => CRM_Utils_Type::T_BOOLEAN,
173 'title' => ts('Participant Status is Active') ,
174 'description' => 'whether this status type is active',
175 'default' => '1',
176 ) ,
177 'is_counted' => array(
178 'name' => 'is_counted',
179 'type' => CRM_Utils_Type::T_BOOLEAN,
180 'title' => ts('Participant Status Counts?') ,
181 'description' => 'whether this status type is counted against event size limit',
182 ) ,
183 'weight' => array(
184 'name' => 'weight',
185 'type' => CRM_Utils_Type::T_INT,
186 'title' => ts('Order') ,
187 'description' => 'controls sort order',
188 'required' => true,
189 ) ,
190 'visibility_id' => array(
191 'name' => 'visibility_id',
192 'type' => CRM_Utils_Type::T_INT,
193 'title' => ts('Participant Status Visibility') ,
194 'description' => 'whether the status type is visible to the public, an implicit foreign key to option_value.value related to the `visibility` option_group',
195 'html' => array(
196 'type' => 'Select',
197 ) ,
198 'pseudoconstant' => array(
199 'optionGroupName' => 'visibility',
200 'optionEditPath' => 'civicrm/admin/options/visibility',
201 )
202 ) ,
203 );
204 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
205 }
206 return Civi::$statics[__CLASS__]['fields'];
207 }
208 /**
209 * Return a mapping from field-name to the corresponding key (as used in fields()).
210 *
211 * @return array
212 * Array(string $name => string $uniqueName).
213 */
214 static function &fieldKeys() {
215 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
216 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
217 }
218 return Civi::$statics[__CLASS__]['fieldKeys'];
219 }
220 /**
221 * Returns the names of this table
222 *
223 * @return string
224 */
225 static function getTableName() {
226 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
227 }
228 /**
229 * Returns if this table needs to be logged
230 *
231 * @return boolean
232 */
233 function getLog() {
234 return self::$_log;
235 }
236 /**
237 * Returns the list of fields that can be imported
238 *
239 * @param bool $prefix
240 *
241 * @return array
242 */
243 static function &import($prefix = false) {
244 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'participant_status_type', $prefix, array());
245 return $r;
246 }
247 /**
248 * Returns the list of fields that can be exported
249 *
250 * @param bool $prefix
251 *
252 * @return array
253 */
254 static function &export($prefix = false) {
255 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'participant_status_type', $prefix, array());
256 return $r;
257 }
258 }