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:92eb680369ce37591734a961f22ce831)
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
37 * @var int|string|null
38 * (SQL type: int unsigned)
39 * Note that values will be retrieved from the database as a string.
44 * Machine name for Case Type
47 * (SQL type: varchar(64))
48 * Note that values will be retrieved from the database as a string.
53 * Natural language name for Case Type
56 * (SQL type: varchar(64))
57 * Note that values will be retrieved from the database as a string.
62 * Description of the Case Type
65 * (SQL type: varchar(255))
66 * Note that values will be retrieved from the database as a string.
71 * Is this case type enabled?
75 * Note that values will be retrieved from the database as a string.
80 * Is this case type a predefined system type?
84 * Note that values will be retrieved from the database as a string.
89 * Ordering of the case types
93 * Note that values will be retrieved from the database as a string.
98 * xml definition of case type
102 * Note that values will be retrieved from the database as a string.
109 public function __construct() {
110 $this->__table
= 'civicrm_case_type';
111 parent
::__construct();
115 * Returns localized title of this entity.
117 * @param bool $plural
118 * Whether to return the plural version of the title.
120 public static function getEntityTitle($plural = FALSE) {
121 return $plural ?
ts('Case Types') : ts('Case Type');
125 * Returns all the column names of this table
129 public static function &fields() {
130 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
131 Civi
::$statics[__CLASS__
]['fields'] = [
134 'type' => CRM_Utils_Type
::T_INT
,
135 'title' => ts('Case Type ID'),
136 'description' => ts('Autoincremented type id'),
138 'where' => 'civicrm_case_type.id',
139 'table_name' => 'civicrm_case_type',
140 'entity' => 'CaseType',
141 'bao' => 'CRM_Case_BAO_CaseType',
151 'type' => CRM_Utils_Type
::T_STRING
,
152 'title' => ts('Case Type Name'),
153 'description' => ts('Machine name for Case Type'),
156 'size' => CRM_Utils_Type
::BIG
,
157 'where' => 'civicrm_case_type.name',
158 'table_name' => 'civicrm_case_type',
159 'entity' => 'CaseType',
160 'bao' => 'CRM_Case_BAO_CaseType',
169 'type' => CRM_Utils_Type
::T_STRING
,
170 'title' => ts('Case Type Title'),
171 'description' => ts('Natural language name for Case Type'),
174 'size' => CRM_Utils_Type
::BIG
,
175 'where' => 'civicrm_case_type.title',
176 'table_name' => 'civicrm_case_type',
177 'entity' => 'CaseType',
178 'bao' => 'CRM_Case_BAO_CaseType',
186 'name' => 'description',
187 'type' => CRM_Utils_Type
::T_STRING
,
188 'title' => ts('Case Type Description'),
189 'description' => ts('Description of the Case Type'),
191 'size' => CRM_Utils_Type
::HUGE
,
192 'where' => 'civicrm_case_type.description',
193 'table_name' => 'civicrm_case_type',
194 'entity' => 'CaseType',
195 'bao' => 'CRM_Case_BAO_CaseType',
203 'name' => 'is_active',
204 'type' => CRM_Utils_Type
::T_BOOLEAN
,
205 'title' => ts('Case Type Is Active'),
206 'description' => ts('Is this case type enabled?'),
208 'where' => 'civicrm_case_type.is_active',
210 'table_name' => 'civicrm_case_type',
211 'entity' => 'CaseType',
212 'bao' => 'CRM_Case_BAO_CaseType',
215 'type' => 'CheckBox',
220 'name' => 'is_reserved',
221 'type' => CRM_Utils_Type
::T_BOOLEAN
,
222 'title' => ts('Case Type Is Reserved'),
223 'description' => ts('Is this case type a predefined system type?'),
225 'where' => 'civicrm_case_type.is_reserved',
227 'table_name' => 'civicrm_case_type',
228 'entity' => 'CaseType',
229 'bao' => 'CRM_Case_BAO_CaseType',
232 'type' => 'CheckBox',
238 'type' => CRM_Utils_Type
::T_INT
,
239 'title' => ts('Order'),
240 'description' => ts('Ordering of the case types'),
242 'where' => 'civicrm_case_type.weight',
244 'table_name' => 'civicrm_case_type',
245 'entity' => 'CaseType',
246 'bao' => 'CRM_Case_BAO_CaseType',
254 'name' => 'definition',
255 'type' => CRM_Utils_Type
::T_BLOB
,
256 'title' => ts('Case Type Definition'),
257 'description' => ts('xml definition of case type'),
258 'where' => 'civicrm_case_type.definition',
259 'table_name' => 'civicrm_case_type',
260 'entity' => 'CaseType',
261 'bao' => 'CRM_Case_BAO_CaseType',
266 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
268 return Civi
::$statics[__CLASS__
]['fields'];
272 * Return a mapping from field-name to the corresponding key (as used in fields()).
275 * Array(string $name => string $uniqueName).
277 public static function &fieldKeys() {
278 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
279 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
281 return Civi
::$statics[__CLASS__
]['fieldKeys'];
285 * Returns the names of this table
289 public static function getTableName() {
290 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
294 * Returns if this table needs to be logged
298 public function getLog() {
303 * Returns the list of fields that can be imported
305 * @param bool $prefix
309 public static function &import($prefix = FALSE) {
310 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'case_type', $prefix, []);
315 * Returns the list of fields that can be exported
317 * @param bool $prefix
321 public static function &export($prefix = FALSE) {
322 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'case_type', $prefix, []);
327 * Returns the list of indices
329 * @param bool $localize
333 public static function indices($localize = TRUE) {
335 'case_type_name' => [
336 'name' => 'case_type_name',
340 'localizable' => FALSE,
342 'sig' => 'civicrm_case_type::1::name',
345 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;