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:91266a2984e12a7526d5a6b13a901c63)
13 * Database access object for the CaseType entity.
15 class CRM_Case_DAO_CaseType
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_case_type';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
32 * Autoincremented type id
39 * Machine name for Case Type
46 * Natural language name for Case Type
53 * Description of the Case Type
60 * Is this entry active?
67 * Is this case type a predefined system type?
74 * Ordering of the case types
81 * xml definition of case type
90 public function __construct() {
91 $this->__table
= 'civicrm_case_type';
92 parent
::__construct();
96 * Returns localized title of this entity.
98 public static function getEntityTitle() {
99 return ts('Case Types');
103 * Returns all the column names of this table
107 public static function &fields() {
108 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
109 Civi
::$statics[__CLASS__
]['fields'] = [
112 'type' => CRM_Utils_Type
::T_INT
,
113 'title' => ts('Case Type ID'),
114 'description' => ts('Autoincremented type id'),
116 'where' => 'civicrm_case_type.id',
117 'table_name' => 'civicrm_case_type',
118 'entity' => 'CaseType',
119 'bao' => 'CRM_Case_BAO_CaseType',
124 'type' => CRM_Utils_Type
::T_STRING
,
125 'title' => ts('Case Type Name'),
126 'description' => ts('Machine name for Case Type'),
129 'size' => CRM_Utils_Type
::BIG
,
130 'where' => 'civicrm_case_type.name',
131 'table_name' => 'civicrm_case_type',
132 'entity' => 'CaseType',
133 'bao' => 'CRM_Case_BAO_CaseType',
138 'type' => CRM_Utils_Type
::T_STRING
,
139 'title' => ts('Case Type Title'),
140 'description' => ts('Natural language name for Case Type'),
143 'size' => CRM_Utils_Type
::BIG
,
144 'where' => 'civicrm_case_type.title',
145 'table_name' => 'civicrm_case_type',
146 'entity' => 'CaseType',
147 'bao' => 'CRM_Case_BAO_CaseType',
151 'name' => 'description',
152 'type' => CRM_Utils_Type
::T_STRING
,
153 'title' => ts('Case Type Description'),
154 'description' => ts('Description of the Case Type'),
156 'size' => CRM_Utils_Type
::HUGE
,
157 'where' => 'civicrm_case_type.description',
158 'table_name' => 'civicrm_case_type',
159 'entity' => 'CaseType',
160 'bao' => 'CRM_Case_BAO_CaseType',
164 'name' => 'is_active',
165 'type' => CRM_Utils_Type
::T_BOOLEAN
,
166 'title' => ts('Case Type Is Active'),
167 'description' => ts('Is this entry active?'),
168 'where' => 'civicrm_case_type.is_active',
169 'table_name' => 'civicrm_case_type',
170 'entity' => 'CaseType',
171 'bao' => 'CRM_Case_BAO_CaseType',
175 'name' => 'is_reserved',
176 'type' => CRM_Utils_Type
::T_BOOLEAN
,
177 'title' => ts('Case Type Is Reserved'),
178 'description' => ts('Is this case type a predefined system type?'),
179 'where' => 'civicrm_case_type.is_reserved',
180 'table_name' => 'civicrm_case_type',
181 'entity' => 'CaseType',
182 'bao' => 'CRM_Case_BAO_CaseType',
187 'type' => CRM_Utils_Type
::T_INT
,
188 'title' => ts('Order'),
189 'description' => ts('Ordering of the case types'),
191 'where' => 'civicrm_case_type.weight',
193 'table_name' => 'civicrm_case_type',
194 'entity' => 'CaseType',
195 'bao' => 'CRM_Case_BAO_CaseType',
199 'name' => 'definition',
200 'type' => CRM_Utils_Type
::T_BLOB
,
201 'title' => ts('Case Type Definition'),
202 'description' => ts('xml definition of case type'),
203 'where' => 'civicrm_case_type.definition',
204 'table_name' => 'civicrm_case_type',
205 'entity' => 'CaseType',
206 'bao' => 'CRM_Case_BAO_CaseType',
210 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
212 return Civi
::$statics[__CLASS__
]['fields'];
216 * Return a mapping from field-name to the corresponding key (as used in fields()).
219 * Array(string $name => string $uniqueName).
221 public static function &fieldKeys() {
222 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
223 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
225 return Civi
::$statics[__CLASS__
]['fieldKeys'];
229 * Returns the names of this table
233 public static function getTableName() {
234 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
238 * Returns if this table needs to be logged
242 public function getLog() {
247 * Returns the list of fields that can be imported
249 * @param bool $prefix
253 public static function &import($prefix = FALSE) {
254 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'case_type', $prefix, []);
259 * Returns the list of fields that can be exported
261 * @param bool $prefix
265 public static function &export($prefix = FALSE) {
266 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'case_type', $prefix, []);
271 * Returns the list of indices
273 * @param bool $localize
277 public static function indices($localize = TRUE) {
279 'case_type_name' => [
280 'name' => 'case_type_name',
284 'localizable' => FALSE,
286 'sig' => 'civicrm_case_type::1::name',
289 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;