Merge pull request #17510 from mattwire/paymentprocessorinstrumentnotrequired
[civicrm-core.git] / CRM / Case / DAO / CaseType.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Case/CaseType.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:91266a2984e12a7526d5a6b13a901c63)
10 */
11
12 /**
13 * Database access object for the CaseType entity.
14 */
15 class CRM_Case_DAO_CaseType extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_case_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 * Autoincremented type id
33 *
34 * @var int
35 */
36 public $id;
37
38 /**
39 * Machine name for Case Type
40 *
41 * @var string
42 */
43 public $name;
44
45 /**
46 * Natural language name for Case Type
47 *
48 * @var string
49 */
50 public $title;
51
52 /**
53 * Description of the Case Type
54 *
55 * @var string
56 */
57 public $description;
58
59 /**
60 * Is this entry active?
61 *
62 * @var bool
63 */
64 public $is_active;
65
66 /**
67 * Is this case type a predefined system type?
68 *
69 * @var bool
70 */
71 public $is_reserved;
72
73 /**
74 * Ordering of the case types
75 *
76 * @var int
77 */
78 public $weight;
79
80 /**
81 * xml definition of case type
82 *
83 * @var blob
84 */
85 public $definition;
86
87 /**
88 * Class constructor.
89 */
90 public function __construct() {
91 $this->__table = 'civicrm_case_type';
92 parent::__construct();
93 }
94
95 /**
96 * Returns localized title of this entity.
97 */
98 public static function getEntityTitle() {
99 return ts('Case Types');
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('Case Type ID'),
114 'description' => ts('Autoincremented type id'),
115 'required' => TRUE,
116 'where' => 'civicrm_case_type.id',
117 'table_name' => 'civicrm_case_type',
118 'entity' => 'CaseType',
119 'bao' => 'CRM_Case_BAO_CaseType',
120 'localizable' => 0,
121 ],
122 'name' => [
123 'name' => 'name',
124 'type' => CRM_Utils_Type::T_STRING,
125 'title' => ts('Case Type Name'),
126 'description' => ts('Machine name for Case Type'),
127 'required' => TRUE,
128 'maxlength' => 64,
129 'size' => CRM_Utils_Type::BIG,
130 'where' => 'civicrm_case_type.name',
131 'table_name' => 'civicrm_case_type',
132 'entity' => 'CaseType',
133 'bao' => 'CRM_Case_BAO_CaseType',
134 'localizable' => 0,
135 ],
136 'title' => [
137 'name' => 'title',
138 'type' => CRM_Utils_Type::T_STRING,
139 'title' => ts('Case Type Title'),
140 'description' => ts('Natural language name for Case Type'),
141 'required' => TRUE,
142 'maxlength' => 64,
143 'size' => CRM_Utils_Type::BIG,
144 'where' => 'civicrm_case_type.title',
145 'table_name' => 'civicrm_case_type',
146 'entity' => 'CaseType',
147 'bao' => 'CRM_Case_BAO_CaseType',
148 'localizable' => 1,
149 ],
150 'description' => [
151 'name' => 'description',
152 'type' => CRM_Utils_Type::T_STRING,
153 'title' => ts('Case Type Description'),
154 'description' => ts('Description of the Case Type'),
155 'maxlength' => 255,
156 'size' => CRM_Utils_Type::HUGE,
157 'where' => 'civicrm_case_type.description',
158 'table_name' => 'civicrm_case_type',
159 'entity' => 'CaseType',
160 'bao' => 'CRM_Case_BAO_CaseType',
161 'localizable' => 1,
162 ],
163 'is_active' => [
164 'name' => 'is_active',
165 'type' => CRM_Utils_Type::T_BOOLEAN,
166 'title' => ts('Case Type Is Active'),
167 'description' => ts('Is this entry active?'),
168 'where' => 'civicrm_case_type.is_active',
169 'table_name' => 'civicrm_case_type',
170 'entity' => 'CaseType',
171 'bao' => 'CRM_Case_BAO_CaseType',
172 'localizable' => 0,
173 ],
174 'is_reserved' => [
175 'name' => 'is_reserved',
176 'type' => CRM_Utils_Type::T_BOOLEAN,
177 'title' => ts('Case Type Is Reserved'),
178 'description' => ts('Is this case type a predefined system type?'),
179 'where' => 'civicrm_case_type.is_reserved',
180 'table_name' => 'civicrm_case_type',
181 'entity' => 'CaseType',
182 'bao' => 'CRM_Case_BAO_CaseType',
183 'localizable' => 0,
184 ],
185 'weight' => [
186 'name' => 'weight',
187 'type' => CRM_Utils_Type::T_INT,
188 'title' => ts('Order'),
189 'description' => ts('Ordering of the case types'),
190 'required' => TRUE,
191 'where' => 'civicrm_case_type.weight',
192 'default' => '1',
193 'table_name' => 'civicrm_case_type',
194 'entity' => 'CaseType',
195 'bao' => 'CRM_Case_BAO_CaseType',
196 'localizable' => 0,
197 ],
198 'definition' => [
199 'name' => 'definition',
200 'type' => CRM_Utils_Type::T_BLOB,
201 'title' => ts('Case Type Definition'),
202 'description' => ts('xml definition of case type'),
203 'where' => 'civicrm_case_type.definition',
204 'table_name' => 'civicrm_case_type',
205 'entity' => 'CaseType',
206 'bao' => 'CRM_Case_BAO_CaseType',
207 'localizable' => 0,
208 ],
209 ];
210 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
211 }
212 return Civi::$statics[__CLASS__]['fields'];
213 }
214
215 /**
216 * Return a mapping from field-name to the corresponding key (as used in fields()).
217 *
218 * @return array
219 * Array(string $name => string $uniqueName).
220 */
221 public static function &fieldKeys() {
222 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
223 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
224 }
225 return Civi::$statics[__CLASS__]['fieldKeys'];
226 }
227
228 /**
229 * Returns the names of this table
230 *
231 * @return string
232 */
233 public static function getTableName() {
234 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
235 }
236
237 /**
238 * Returns if this table needs to be logged
239 *
240 * @return bool
241 */
242 public function getLog() {
243 return self::$_log;
244 }
245
246 /**
247 * Returns the list of fields that can be imported
248 *
249 * @param bool $prefix
250 *
251 * @return array
252 */
253 public static function &import($prefix = FALSE) {
254 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'case_type', $prefix, []);
255 return $r;
256 }
257
258 /**
259 * Returns the list of fields that can be exported
260 *
261 * @param bool $prefix
262 *
263 * @return array
264 */
265 public static function &export($prefix = FALSE) {
266 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'case_type', $prefix, []);
267 return $r;
268 }
269
270 /**
271 * Returns the list of indices
272 *
273 * @param bool $localize
274 *
275 * @return array
276 */
277 public static function indices($localize = TRUE) {
278 $indices = [
279 'case_type_name' => [
280 'name' => 'case_type_name',
281 'field' => [
282 0 => 'name',
283 ],
284 'localizable' => FALSE,
285 'unique' => TRUE,
286 'sig' => 'civicrm_case_type::1::name',
287 ],
288 ];
289 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
290 }
291
292 }