3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Case/Case.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:e45e7e2a53a945c4659cf393410a9d7a)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Case_DAO_Case constructor.
40 class CRM_Case_DAO_Case
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_case';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * FK to civicrm_case_type.id
66 * Short name of the case.
72 * Date on which given case starts.
78 * Date on which given case ends.
84 * Details about the meeting (agenda, notes, etc).
103 function __construct() {
104 $this->__table
= 'civicrm_case';
105 parent
::__construct();
108 * Returns foreign keys and entity references.
111 * [CRM_Core_Reference_Interface]
113 static function getReferenceColumns() {
114 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
115 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
116 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'case_type_id', 'civicrm_case_type', 'id');
117 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
119 return Civi
::$statics[__CLASS__
]['links'];
122 * Returns all the column names of this table
126 static function &fields() {
127 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
128 Civi
::$statics[__CLASS__
]['fields'] = array(
131 'type' => CRM_Utils_Type
::T_INT
,
132 'title' => ts('Case ID') ,
133 'description' => 'Unique Case ID',
136 'where' => 'civicrm_case.id',
137 'headerPattern' => '',
140 'table_name' => 'civicrm_case',
142 'bao' => 'CRM_Case_BAO_Case',
145 'case_type_id' => array(
146 'name' => 'case_type_id',
147 'type' => CRM_Utils_Type
::T_INT
,
148 'title' => ts('Case Type') ,
149 'description' => 'FK to civicrm_case_type.id',
152 'where' => 'civicrm_case.case_type_id',
153 'headerPattern' => '',
156 'table_name' => 'civicrm_case',
158 'bao' => 'CRM_Case_BAO_Case',
160 'FKClassName' => 'CRM_Case_DAO_CaseType',
164 'pseudoconstant' => array(
165 'table' => 'civicrm_case_type',
167 'labelColumn' => 'title',
170 'case_subject' => array(
172 'type' => CRM_Utils_Type
::T_STRING
,
173 'title' => ts('Case Subject') ,
174 'description' => 'Short name of the case.',
176 'size' => CRM_Utils_Type
::HUGE
,
178 'where' => 'civicrm_case.subject',
179 'headerPattern' => '',
182 'table_name' => 'civicrm_case',
184 'bao' => 'CRM_Case_BAO_Case',
190 'case_start_date' => array(
191 'name' => 'start_date',
192 'type' => CRM_Utils_Type
::T_DATE
,
193 'title' => ts('Case Start Date') ,
194 'description' => 'Date on which given case starts.',
196 'where' => 'civicrm_case.start_date',
197 'headerPattern' => '',
200 'table_name' => 'civicrm_case',
202 'bao' => 'CRM_Case_BAO_Case',
205 'type' => 'Select Date',
208 'case_end_date' => array(
209 'name' => 'end_date',
210 'type' => CRM_Utils_Type
::T_DATE
,
211 'title' => ts('Case End Date') ,
212 'description' => 'Date on which given case ends.',
214 'where' => 'civicrm_case.end_date',
215 'headerPattern' => '',
218 'table_name' => 'civicrm_case',
220 'bao' => 'CRM_Case_BAO_Case',
223 'type' => 'Select Date',
228 'type' => CRM_Utils_Type
::T_TEXT
,
229 'title' => ts('Details') ,
230 'description' => 'Details about the meeting (agenda, notes, etc).',
233 'table_name' => 'civicrm_case',
235 'bao' => 'CRM_Case_BAO_Case',
238 'type' => 'TextArea',
241 'case_status_id' => array(
242 'name' => 'status_id',
243 'type' => CRM_Utils_Type
::T_INT
,
244 'title' => ts('Case Status') ,
245 'description' => 'Id of case status.',
248 'where' => 'civicrm_case.status_id',
249 'headerPattern' => '',
252 'table_name' => 'civicrm_case',
254 'bao' => 'CRM_Case_BAO_Case',
259 'pseudoconstant' => array(
260 'optionGroupName' => 'case_status',
261 'optionEditPath' => 'civicrm/admin/options/case_status',
264 'case_deleted' => array(
265 'name' => 'is_deleted',
266 'type' => CRM_Utils_Type
::T_BOOLEAN
,
267 'title' => ts('Case is in the Trash') ,
269 'where' => 'civicrm_case.is_deleted',
270 'headerPattern' => '',
273 'table_name' => 'civicrm_case',
275 'bao' => 'CRM_Case_BAO_Case',
279 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
281 return Civi
::$statics[__CLASS__
]['fields'];
284 * Return a mapping from field-name to the corresponding key (as used in fields()).
287 * Array(string $name => string $uniqueName).
289 static function &fieldKeys() {
290 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
291 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
293 return Civi
::$statics[__CLASS__
]['fieldKeys'];
296 * Returns the names of this table
300 static function getTableName() {
301 return self
::$_tableName;
304 * Returns if this table needs to be logged
312 * Returns the list of fields that can be imported
314 * @param bool $prefix
318 static function &import($prefix = false) {
319 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'case', $prefix, array());
323 * Returns the list of fields that can be exported
325 * @param bool $prefix
329 static function &export($prefix = false) {
330 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'case', $prefix, array());
334 * Returns the list of indices
336 public static function indices($localize = TRUE) {
338 'index_case_type_id' => array(
339 'name' => 'index_case_type_id',
343 'localizable' => false,
344 'sig' => 'civicrm_case::0::case_type_id',
346 'index_is_deleted' => array(
347 'name' => 'index_is_deleted',
351 'localizable' => false,
352 'sig' => 'civicrm_case::0::is_deleted',
355 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;