Regenerate DAO files
[civicrm-core.git] / CRM / Case / DAO / CaseType.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Case/CaseType.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:317907ffe519c3f3eab8af9d8e9e1f7f)
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 all the column names of this table
97 *
98 * @return array
99 */
100 public static function &fields() {
101 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
102 Civi::$statics[__CLASS__]['fields'] = [
103 'id' => [
104 'name' => 'id',
105 'type' => CRM_Utils_Type::T_INT,
106 'title' => ts('Case Type ID'),
107 'description' => ts('Autoincremented type id'),
108 'required' => TRUE,
109 'where' => 'civicrm_case_type.id',
110 'table_name' => 'civicrm_case_type',
111 'entity' => 'CaseType',
112 'bao' => 'CRM_Case_BAO_CaseType',
113 'localizable' => 0,
114 ],
115 'name' => [
116 'name' => 'name',
117 'type' => CRM_Utils_Type::T_STRING,
118 'title' => ts('Case Type Name'),
119 'description' => ts('Machine name for Case Type'),
120 'required' => TRUE,
121 'maxlength' => 64,
122 'size' => CRM_Utils_Type::BIG,
123 'where' => 'civicrm_case_type.name',
124 'table_name' => 'civicrm_case_type',
125 'entity' => 'CaseType',
126 'bao' => 'CRM_Case_BAO_CaseType',
127 'localizable' => 0,
128 ],
129 'title' => [
130 'name' => 'title',
131 'type' => CRM_Utils_Type::T_STRING,
132 'title' => ts('Case Type Title'),
133 'description' => ts('Natural language name for Case Type'),
134 'required' => TRUE,
135 'maxlength' => 64,
136 'size' => CRM_Utils_Type::BIG,
137 'where' => 'civicrm_case_type.title',
138 'table_name' => 'civicrm_case_type',
139 'entity' => 'CaseType',
140 'bao' => 'CRM_Case_BAO_CaseType',
141 'localizable' => 1,
142 ],
143 'description' => [
144 'name' => 'description',
145 'type' => CRM_Utils_Type::T_STRING,
146 'title' => ts('Case Type Description'),
147 'description' => ts('Description of the Case Type'),
148 'maxlength' => 255,
149 'size' => CRM_Utils_Type::HUGE,
150 'where' => 'civicrm_case_type.description',
151 'table_name' => 'civicrm_case_type',
152 'entity' => 'CaseType',
153 'bao' => 'CRM_Case_BAO_CaseType',
154 'localizable' => 1,
155 ],
156 'is_active' => [
157 'name' => 'is_active',
158 'type' => CRM_Utils_Type::T_BOOLEAN,
159 'title' => ts('Case Type Is Active'),
160 'description' => ts('Is this entry active?'),
161 'where' => 'civicrm_case_type.is_active',
162 'table_name' => 'civicrm_case_type',
163 'entity' => 'CaseType',
164 'bao' => 'CRM_Case_BAO_CaseType',
165 'localizable' => 0,
166 ],
167 'is_reserved' => [
168 'name' => 'is_reserved',
169 'type' => CRM_Utils_Type::T_BOOLEAN,
170 'title' => ts('Case Type Is Reserved'),
171 'description' => ts('Is this case type a predefined system type?'),
172 'where' => 'civicrm_case_type.is_reserved',
173 'table_name' => 'civicrm_case_type',
174 'entity' => 'CaseType',
175 'bao' => 'CRM_Case_BAO_CaseType',
176 'localizable' => 0,
177 ],
178 'weight' => [
179 'name' => 'weight',
180 'type' => CRM_Utils_Type::T_INT,
181 'title' => ts('Order'),
182 'description' => ts('Ordering of the case types'),
183 'required' => TRUE,
184 'where' => 'civicrm_case_type.weight',
185 'default' => '1',
186 'table_name' => 'civicrm_case_type',
187 'entity' => 'CaseType',
188 'bao' => 'CRM_Case_BAO_CaseType',
189 'localizable' => 0,
190 ],
191 'definition' => [
192 'name' => 'definition',
193 'type' => CRM_Utils_Type::T_BLOB,
194 'title' => ts('Case Type Definition'),
195 'description' => ts('xml definition of case type'),
196 'where' => 'civicrm_case_type.definition',
197 'table_name' => 'civicrm_case_type',
198 'entity' => 'CaseType',
199 'bao' => 'CRM_Case_BAO_CaseType',
200 'localizable' => 0,
201 ],
202 ];
203 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
204 }
205 return Civi::$statics[__CLASS__]['fields'];
206 }
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 public 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 /**
222 * Returns the names of this table
223 *
224 * @return string
225 */
226 public static function getTableName() {
227 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
228 }
229
230 /**
231 * Returns if this table needs to be logged
232 *
233 * @return bool
234 */
235 public function getLog() {
236 return self::$_log;
237 }
238
239 /**
240 * Returns the list of fields that can be imported
241 *
242 * @param bool $prefix
243 *
244 * @return array
245 */
246 public static function &import($prefix = FALSE) {
247 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'case_type', $prefix, []);
248 return $r;
249 }
250
251 /**
252 * Returns the list of fields that can be exported
253 *
254 * @param bool $prefix
255 *
256 * @return array
257 */
258 public static function &export($prefix = FALSE) {
259 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'case_type', $prefix, []);
260 return $r;
261 }
262
263 /**
264 * Returns the list of indices
265 *
266 * @param bool $localize
267 *
268 * @return array
269 */
270 public static function indices($localize = TRUE) {
271 $indices = [
272 'case_type_name' => [
273 'name' => 'case_type_name',
274 'field' => [
275 0 => 'name',
276 ],
277 'localizable' => FALSE,
278 'unique' => TRUE,
279 'sig' => 'civicrm_case_type::1::name',
280 ],
281 ];
282 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
283 }
284
285 }