CRM-20312 add field localisation data to DAO.
[civicrm-core.git] / CRM / Case / DAO / CaseType.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
0f03f337 6| Copyright CiviCRM LLC (c) 2004-2017 |
e501603b
TO
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
0f03f337 29 * @copyright CiviCRM LLC (c) 2004-2017
e501603b
TO
30 *
31 * Generated from xml/schema/CRM/Case/CaseType.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
022785d8 33 * (GenCodeChecksum:83343ea4b40dbc52f046f542d8f80d53)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
f41f0342 37/**
38 * CRM_Case_DAO_CaseType constructor.
39 */
e501603b
TO
40class CRM_Case_DAO_CaseType extends CRM_Core_DAO {
41 /**
f41f0342 42 * Static instance to hold the table name.
e501603b
TO
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_case_type';
e501603b 47 /**
f41f0342 48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b
TO
49 *
50 * @var boolean
51 */
52 static $_log = true;
53 /**
54 * Autoincremented type id
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 * Machine name for Case Type
61 *
62 * @var string
63 */
64 public $name;
65 /**
66 * Natural language name for Case Type
67 *
68 * @var string
69 */
70 public $title;
71 /**
72 * Description of the Case Type
73 *
74 * @var string
75 */
76 public $description;
77 /**
78 * Is this entry active?
79 *
80 * @var boolean
81 */
82 public $is_active;
83 /**
84 * Is this case type a predefined system type?
85 *
86 * @var boolean
87 */
88 public $is_reserved;
89 /**
90 * Ordering of the case types
91 *
92 * @var int
93 */
94 public $weight;
95 /**
96 * xml definition of case type
97 *
98 * @var blob
99 */
100 public $definition;
101 /**
f41f0342 102 * Class constructor.
e501603b
TO
103 */
104 function __construct() {
105 $this->__table = 'civicrm_case_type';
106 parent::__construct();
107 }
108 /**
109 * Returns all the column names of this table
110 *
111 * @return array
112 */
113 static function &fields() {
346aaaba
TO
114 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
115 Civi::$statics[__CLASS__]['fields'] = array(
e501603b
TO
116 'id' => array(
117 'name' => 'id',
118 'type' => CRM_Utils_Type::T_INT,
119 'title' => ts('Case Type ID') ,
120 'description' => 'Autoincremented type id',
121 'required' => true,
522a26c9 122 'table_name' => 'civicrm_case_type',
123 'entity' => 'CaseType',
124 'bao' => 'CRM_Case_BAO_CaseType',
e501603b
TO
125 ) ,
126 'name' => array(
127 'name' => 'name',
128 'type' => CRM_Utils_Type::T_STRING,
129 'title' => ts('Case Type Name') ,
130 'description' => 'Machine name for Case Type',
131 'required' => true,
132 'maxlength' => 64,
133 'size' => CRM_Utils_Type::BIG,
522a26c9 134 'table_name' => 'civicrm_case_type',
135 'entity' => 'CaseType',
136 'bao' => 'CRM_Case_BAO_CaseType',
e501603b
TO
137 ) ,
138 'title' => array(
139 'name' => 'title',
140 'type' => CRM_Utils_Type::T_STRING,
141 'title' => ts('Case Type Title') ,
142 'description' => 'Natural language name for Case Type',
143 'required' => true,
144 'maxlength' => 64,
145 'size' => CRM_Utils_Type::BIG,
522a26c9 146 'table_name' => 'civicrm_case_type',
147 'entity' => 'CaseType',
148 'bao' => 'CRM_Case_BAO_CaseType',
e501603b
TO
149 ) ,
150 'description' => array(
151 'name' => 'description',
152 'type' => CRM_Utils_Type::T_STRING,
153 'title' => ts('Case Type Description') ,
154 'description' => 'Description of the Case Type',
155 'maxlength' => 255,
156 'size' => CRM_Utils_Type::HUGE,
522a26c9 157 'table_name' => 'civicrm_case_type',
158 'entity' => 'CaseType',
159 'bao' => 'CRM_Case_BAO_CaseType',
e501603b
TO
160 ) ,
161 'is_active' => array(
162 'name' => 'is_active',
163 'type' => CRM_Utils_Type::T_BOOLEAN,
164 'title' => ts('Case Type Is Active') ,
165 'description' => 'Is this entry active?',
522a26c9 166 'table_name' => 'civicrm_case_type',
167 'entity' => 'CaseType',
168 'bao' => 'CRM_Case_BAO_CaseType',
e501603b
TO
169 ) ,
170 'is_reserved' => array(
171 'name' => 'is_reserved',
172 'type' => CRM_Utils_Type::T_BOOLEAN,
173 'title' => ts('Case Type Is Reserved') ,
174 'description' => 'Is this case type a predefined system type?',
522a26c9 175 'table_name' => 'civicrm_case_type',
176 'entity' => 'CaseType',
177 'bao' => 'CRM_Case_BAO_CaseType',
e501603b
TO
178 ) ,
179 'weight' => array(
180 'name' => 'weight',
181 'type' => CRM_Utils_Type::T_INT,
182 'title' => ts('Order') ,
183 'description' => 'Ordering of the case types',
184 'required' => true,
185 'default' => '1',
522a26c9 186 'table_name' => 'civicrm_case_type',
187 'entity' => 'CaseType',
188 'bao' => 'CRM_Case_BAO_CaseType',
e501603b
TO
189 ) ,
190 'definition' => array(
191 'name' => 'definition',
192 'type' => CRM_Utils_Type::T_BLOB,
193 'title' => ts('Case Type Definition') ,
194 'description' => 'xml definition of case type',
522a26c9 195 'table_name' => 'civicrm_case_type',
196 'entity' => 'CaseType',
197 'bao' => 'CRM_Case_BAO_CaseType',
e501603b
TO
198 ) ,
199 );
346aaaba 200 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 201 }
346aaaba 202 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
203 }
204 /**
bd8e0b14 205 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
206 *
207 * @return array
bd8e0b14 208 * Array(string $name => string $uniqueName).
e501603b
TO
209 */
210 static function &fieldKeys() {
bd8e0b14
TO
211 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
212 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 213 }
bd8e0b14 214 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
215 }
216 /**
217 * Returns the names of this table
218 *
219 * @return string
220 */
221 static function getTableName() {
222 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
223 }
224 /**
225 * Returns if this table needs to be logged
226 *
227 * @return boolean
228 */
229 function getLog() {
230 return self::$_log;
231 }
232 /**
233 * Returns the list of fields that can be imported
234 *
235 * @param bool $prefix
236 *
237 * @return array
238 */
239 static function &import($prefix = false) {
60808919
TO
240 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'case_type', $prefix, array());
241 return $r;
e501603b
TO
242 }
243 /**
244 * Returns the list of fields that can be exported
245 *
246 * @param bool $prefix
247 *
248 * @return array
249 */
250 static function &export($prefix = false) {
60808919
TO
251 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'case_type', $prefix, array());
252 return $r;
e501603b
TO
253 }
254}