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:1102802dc49a9899f93c16fce57fa141)
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?
73 * @var bool|string|null
75 * Note that values will be retrieved from the database as a string.
80 * Is this case type a predefined system type?
82 * @var bool|string|null
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',
166 'type' => CRM_Utils_Type
::T_STRING
,
167 'title' => ts('Case Type Title'),
168 'description' => ts('Natural language name for Case Type'),
171 'size' => CRM_Utils_Type
::BIG
,
172 'where' => 'civicrm_case_type.title',
173 'table_name' => 'civicrm_case_type',
174 'entity' => 'CaseType',
175 'bao' => 'CRM_Case_BAO_CaseType',
180 'name' => 'description',
181 'type' => CRM_Utils_Type
::T_STRING
,
182 'title' => ts('Case Type Description'),
183 'description' => ts('Description of the Case Type'),
185 'size' => CRM_Utils_Type
::HUGE
,
186 'where' => 'civicrm_case_type.description',
187 'table_name' => 'civicrm_case_type',
188 'entity' => 'CaseType',
189 'bao' => 'CRM_Case_BAO_CaseType',
194 'name' => 'is_active',
195 'type' => CRM_Utils_Type
::T_BOOLEAN
,
196 'title' => ts('Case Type Is Active'),
197 'description' => ts('Is this case type enabled?'),
198 'where' => 'civicrm_case_type.is_active',
200 'table_name' => 'civicrm_case_type',
201 'entity' => 'CaseType',
202 'bao' => 'CRM_Case_BAO_CaseType',
207 'name' => 'is_reserved',
208 'type' => CRM_Utils_Type
::T_BOOLEAN
,
209 'title' => ts('Case Type Is Reserved'),
210 'description' => ts('Is this case type a predefined system type?'),
211 'where' => 'civicrm_case_type.is_reserved',
212 'table_name' => 'civicrm_case_type',
213 'entity' => 'CaseType',
214 'bao' => 'CRM_Case_BAO_CaseType',
220 'type' => CRM_Utils_Type
::T_INT
,
221 'title' => ts('Order'),
222 'description' => ts('Ordering of the case types'),
224 'where' => 'civicrm_case_type.weight',
226 'table_name' => 'civicrm_case_type',
227 'entity' => 'CaseType',
228 'bao' => 'CRM_Case_BAO_CaseType',
233 'name' => 'definition',
234 'type' => CRM_Utils_Type
::T_BLOB
,
235 'title' => ts('Case Type Definition'),
236 'description' => ts('xml definition of case type'),
237 'where' => 'civicrm_case_type.definition',
238 'table_name' => 'civicrm_case_type',
239 'entity' => 'CaseType',
240 'bao' => 'CRM_Case_BAO_CaseType',
245 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
247 return Civi
::$statics[__CLASS__
]['fields'];
251 * Return a mapping from field-name to the corresponding key (as used in fields()).
254 * Array(string $name => string $uniqueName).
256 public static function &fieldKeys() {
257 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
258 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
260 return Civi
::$statics[__CLASS__
]['fieldKeys'];
264 * Returns the names of this table
268 public static function getTableName() {
269 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
273 * Returns if this table needs to be logged
277 public function getLog() {
282 * Returns the list of fields that can be imported
284 * @param bool $prefix
288 public static function &import($prefix = FALSE) {
289 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'case_type', $prefix, []);
294 * Returns the list of fields that can be exported
296 * @param bool $prefix
300 public static function &export($prefix = FALSE) {
301 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'case_type', $prefix, []);
306 * Returns the list of indices
308 * @param bool $localize
312 public static function indices($localize = TRUE) {
314 'case_type_name' => [
315 'name' => 'case_type_name',
319 'localizable' => FALSE,
321 'sig' => 'civicrm_case_type::1::name',
324 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;