5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Case/CaseType.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:9080f32e76695319d1e6110372c0900c)
13 * Database access object for the CaseType entity.
15 class CRM_Case_DAO_CaseType
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '4.5';
18 const COMPONENT
= 'CiviCase';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_case_type';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = TRUE;
35 * Autoincremented type id
42 * Machine name for Case Type
49 * Natural language name for Case Type
56 * Description of the Case Type
63 * Is this case type enabled?
70 * Is this case type a predefined system type?
77 * Ordering of the case types
84 * xml definition of case type
93 public function __construct() {
94 $this->__table
= 'civicrm_case_type';
95 parent
::__construct();
99 * Returns localized title of this entity.
101 * @param bool $plural
102 * Whether to return the plural version of the title.
104 public static function getEntityTitle($plural = FALSE) {
105 return $plural ?
ts('Case Types') : ts('Case Type');
109 * Returns all the column names of this table
113 public static function &fields() {
114 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
115 Civi
::$statics[__CLASS__
]['fields'] = [
118 'type' => CRM_Utils_Type
::T_INT
,
119 'title' => ts('Case Type ID'),
120 'description' => ts('Autoincremented type id'),
122 'where' => 'civicrm_case_type.id',
123 'table_name' => 'civicrm_case_type',
124 'entity' => 'CaseType',
125 'bao' => 'CRM_Case_BAO_CaseType',
135 'type' => CRM_Utils_Type
::T_STRING
,
136 'title' => ts('Case Type Name'),
137 'description' => ts('Machine name for Case Type'),
140 'size' => CRM_Utils_Type
::BIG
,
141 'where' => 'civicrm_case_type.name',
142 'table_name' => 'civicrm_case_type',
143 'entity' => 'CaseType',
144 'bao' => 'CRM_Case_BAO_CaseType',
150 'type' => CRM_Utils_Type
::T_STRING
,
151 'title' => ts('Case Type Title'),
152 'description' => ts('Natural language name for Case Type'),
155 'size' => CRM_Utils_Type
::BIG
,
156 'where' => 'civicrm_case_type.title',
157 'table_name' => 'civicrm_case_type',
158 'entity' => 'CaseType',
159 'bao' => 'CRM_Case_BAO_CaseType',
164 'name' => 'description',
165 'type' => CRM_Utils_Type
::T_STRING
,
166 'title' => ts('Case Type Description'),
167 'description' => ts('Description of the Case Type'),
169 'size' => CRM_Utils_Type
::HUGE
,
170 'where' => 'civicrm_case_type.description',
171 'table_name' => 'civicrm_case_type',
172 'entity' => 'CaseType',
173 'bao' => 'CRM_Case_BAO_CaseType',
178 'name' => 'is_active',
179 'type' => CRM_Utils_Type
::T_BOOLEAN
,
180 'title' => ts('Case Type Is Active'),
181 'description' => ts('Is this case type enabled?'),
182 'where' => 'civicrm_case_type.is_active',
184 'table_name' => 'civicrm_case_type',
185 'entity' => 'CaseType',
186 'bao' => 'CRM_Case_BAO_CaseType',
191 'name' => 'is_reserved',
192 'type' => CRM_Utils_Type
::T_BOOLEAN
,
193 'title' => ts('Case Type Is Reserved'),
194 'description' => ts('Is this case type a predefined system type?'),
195 'where' => 'civicrm_case_type.is_reserved',
196 'table_name' => 'civicrm_case_type',
197 'entity' => 'CaseType',
198 'bao' => 'CRM_Case_BAO_CaseType',
204 'type' => CRM_Utils_Type
::T_INT
,
205 'title' => ts('Order'),
206 'description' => ts('Ordering of the case types'),
208 'where' => 'civicrm_case_type.weight',
210 'table_name' => 'civicrm_case_type',
211 'entity' => 'CaseType',
212 'bao' => 'CRM_Case_BAO_CaseType',
217 'name' => 'definition',
218 'type' => CRM_Utils_Type
::T_BLOB
,
219 'title' => ts('Case Type Definition'),
220 'description' => ts('xml definition of case type'),
221 'where' => 'civicrm_case_type.definition',
222 'table_name' => 'civicrm_case_type',
223 'entity' => 'CaseType',
224 'bao' => 'CRM_Case_BAO_CaseType',
229 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
231 return Civi
::$statics[__CLASS__
]['fields'];
235 * Return a mapping from field-name to the corresponding key (as used in fields()).
238 * Array(string $name => string $uniqueName).
240 public static function &fieldKeys() {
241 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
242 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
244 return Civi
::$statics[__CLASS__
]['fieldKeys'];
248 * Returns the names of this table
252 public static function getTableName() {
253 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
257 * Returns if this table needs to be logged
261 public function getLog() {
266 * Returns the list of fields that can be imported
268 * @param bool $prefix
272 public static function &import($prefix = FALSE) {
273 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'case_type', $prefix, []);
278 * Returns the list of fields that can be exported
280 * @param bool $prefix
284 public static function &export($prefix = FALSE) {
285 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'case_type', $prefix, []);
290 * Returns the list of indices
292 * @param bool $localize
296 public static function indices($localize = TRUE) {
298 'case_type_name' => [
299 'name' => 'case_type_name',
303 'localizable' => FALSE,
305 'sig' => 'civicrm_case_type::1::name',
308 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;