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:52f839e38c020cd422ef99dff4ab5f1b)
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';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_case_type';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = TRUE;
34 * Autoincremented type id
41 * Machine name for Case Type
48 * Natural language name for Case Type
55 * Description of the Case Type
62 * Is this entry active?
69 * Is this case type a predefined system type?
76 * Ordering of the case types
83 * xml definition of case type
92 public function __construct() {
93 $this->__table
= 'civicrm_case_type';
94 parent
::__construct();
98 * Returns localized title of this entity.
100 * @param bool $plural
101 * Whether to return the plural version of the title.
103 public static function getEntityTitle($plural = FALSE) {
104 return $plural ?
ts('Case Types') : ts('Case Type');
108 * Returns all the column names of this table
112 public static function &fields() {
113 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
114 Civi
::$statics[__CLASS__
]['fields'] = [
117 'type' => CRM_Utils_Type
::T_INT
,
118 'title' => ts('Case Type ID'),
119 'description' => ts('Autoincremented type id'),
121 'where' => 'civicrm_case_type.id',
122 'table_name' => 'civicrm_case_type',
123 'entity' => 'CaseType',
124 'bao' => 'CRM_Case_BAO_CaseType',
130 'type' => CRM_Utils_Type
::T_STRING
,
131 'title' => ts('Case Type Name'),
132 'description' => ts('Machine name for Case Type'),
135 'size' => CRM_Utils_Type
::BIG
,
136 'where' => 'civicrm_case_type.name',
137 'table_name' => 'civicrm_case_type',
138 'entity' => 'CaseType',
139 'bao' => 'CRM_Case_BAO_CaseType',
145 'type' => CRM_Utils_Type
::T_STRING
,
146 'title' => ts('Case Type Title'),
147 'description' => ts('Natural language name for Case Type'),
150 'size' => CRM_Utils_Type
::BIG
,
151 'where' => 'civicrm_case_type.title',
152 'table_name' => 'civicrm_case_type',
153 'entity' => 'CaseType',
154 'bao' => 'CRM_Case_BAO_CaseType',
159 'name' => 'description',
160 'type' => CRM_Utils_Type
::T_STRING
,
161 'title' => ts('Case Type Description'),
162 'description' => ts('Description of the Case Type'),
164 'size' => CRM_Utils_Type
::HUGE
,
165 'where' => 'civicrm_case_type.description',
166 'table_name' => 'civicrm_case_type',
167 'entity' => 'CaseType',
168 'bao' => 'CRM_Case_BAO_CaseType',
173 'name' => 'is_active',
174 'type' => CRM_Utils_Type
::T_BOOLEAN
,
175 'title' => ts('Case Type Is Active'),
176 'description' => ts('Is this entry active?'),
177 'where' => 'civicrm_case_type.is_active',
178 'table_name' => 'civicrm_case_type',
179 'entity' => 'CaseType',
180 'bao' => 'CRM_Case_BAO_CaseType',
185 'name' => 'is_reserved',
186 'type' => CRM_Utils_Type
::T_BOOLEAN
,
187 'title' => ts('Case Type Is Reserved'),
188 'description' => ts('Is this case type a predefined system type?'),
189 'where' => 'civicrm_case_type.is_reserved',
190 'table_name' => 'civicrm_case_type',
191 'entity' => 'CaseType',
192 'bao' => 'CRM_Case_BAO_CaseType',
198 'type' => CRM_Utils_Type
::T_INT
,
199 'title' => ts('Order'),
200 'description' => ts('Ordering of the case types'),
202 'where' => 'civicrm_case_type.weight',
204 'table_name' => 'civicrm_case_type',
205 'entity' => 'CaseType',
206 'bao' => 'CRM_Case_BAO_CaseType',
211 'name' => 'definition',
212 'type' => CRM_Utils_Type
::T_BLOB
,
213 'title' => ts('Case Type Definition'),
214 'description' => ts('xml definition of case type'),
215 'where' => 'civicrm_case_type.definition',
216 'table_name' => 'civicrm_case_type',
217 'entity' => 'CaseType',
218 'bao' => 'CRM_Case_BAO_CaseType',
223 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
225 return Civi
::$statics[__CLASS__
]['fields'];
229 * Return a mapping from field-name to the corresponding key (as used in fields()).
232 * Array(string $name => string $uniqueName).
234 public static function &fieldKeys() {
235 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
236 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
238 return Civi
::$statics[__CLASS__
]['fieldKeys'];
242 * Returns the names of this table
246 public static function getTableName() {
247 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
251 * Returns if this table needs to be logged
255 public function getLog() {
260 * Returns the list of fields that can be imported
262 * @param bool $prefix
266 public static function &import($prefix = FALSE) {
267 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'case_type', $prefix, []);
272 * Returns the list of fields that can be exported
274 * @param bool $prefix
278 public static function &export($prefix = FALSE) {
279 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'case_type', $prefix, []);
284 * Returns the list of indices
286 * @param bool $localize
290 public static function indices($localize = TRUE) {
292 'case_type_name' => [
293 'name' => 'case_type_name',
297 'localizable' => FALSE,
299 'sig' => 'civicrm_case_type::1::name',
302 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;