3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
31 * Generated from xml/schema/CRM/Case/Case.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:04bab9fc8d6e510321735d25c97ca261)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Case_DAO_Case
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_case';
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
58 * FK to civicrm_case_type.id
64 * Short name of the case.
70 * Date on which given case starts.
76 * Date on which given case ends.
82 * Details about the meeting (agenda, notes, etc).
101 * @return civicrm_case
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' => '',
141 'case_type_id' => array(
142 'name' => 'case_type_id',
143 'type' => CRM_Utils_Type
::T_INT
,
144 'title' => ts('Case Type') ,
145 'description' => 'FK to civicrm_case_type.id',
147 'where' => 'civicrm_case.case_type_id',
148 'headerPattern' => '',
151 'FKClassName' => 'CRM_Case_DAO_CaseType',
155 'pseudoconstant' => array(
156 'table' => 'civicrm_case_type',
158 'labelColumn' => 'title',
161 'case_subject' => array(
163 'type' => CRM_Utils_Type
::T_STRING
,
164 'title' => ts('Case Subject') ,
165 'description' => 'Short name of the case.',
167 'size' => CRM_Utils_Type
::HUGE
,
169 'where' => 'civicrm_case.subject',
170 'headerPattern' => '',
177 'case_start_date' => array(
178 'name' => 'start_date',
179 'type' => CRM_Utils_Type
::T_DATE
,
180 'title' => ts('Case Start Date') ,
181 'description' => 'Date on which given case starts.',
183 'where' => 'civicrm_case.start_date',
184 'headerPattern' => '',
188 'type' => 'Select Date',
191 'case_end_date' => array(
192 'name' => 'end_date',
193 'type' => CRM_Utils_Type
::T_DATE
,
194 'title' => ts('Case End Date') ,
195 'description' => 'Date on which given case ends.',
197 'where' => 'civicrm_case.end_date',
198 'headerPattern' => '',
202 'type' => 'Select Date',
207 'type' => CRM_Utils_Type
::T_TEXT
,
208 'title' => ts('Details') ,
209 'description' => 'Details about the meeting (agenda, notes, etc).',
213 'type' => 'TextArea',
216 'case_status_id' => array(
217 'name' => 'status_id',
218 'type' => CRM_Utils_Type
::T_INT
,
219 'title' => ts('Case Status') ,
220 'description' => 'Id of case status.',
223 'where' => 'civicrm_case.status_id',
224 'headerPattern' => '',
230 'pseudoconstant' => array(
231 'optionGroupName' => 'case_status',
232 'optionEditPath' => 'civicrm/admin/options/case_status',
235 'case_deleted' => array(
236 'name' => 'is_deleted',
237 'type' => CRM_Utils_Type
::T_BOOLEAN
,
238 'title' => ts('Case is in the Trash') ,
240 'where' => 'civicrm_case.is_deleted',
241 'headerPattern' => '',
246 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
248 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 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'];
263 * Returns the names of this table
267 static function getTableName() {
268 return self
::$_tableName;
271 * Returns if this table needs to be logged
279 * Returns the list of fields that can be imported
281 * @param bool $prefix
285 static function &import($prefix = false) {
286 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'case', $prefix, array());
290 * Returns the list of fields that can be exported
292 * @param bool $prefix
296 static function &export($prefix = false) {
297 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'case', $prefix, array());