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:ec4612a24aed71e99dae33589efc40a0)
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',
144 'case_type_id' => array(
145 'name' => 'case_type_id',
146 'type' => CRM_Utils_Type
::T_INT
,
147 'title' => ts('Case Type') ,
148 'description' => 'FK to civicrm_case_type.id',
151 'where' => 'civicrm_case.case_type_id',
152 'headerPattern' => '',
155 'table_name' => 'civicrm_case',
157 'bao' => 'CRM_Case_BAO_Case',
158 'FKClassName' => 'CRM_Case_DAO_CaseType',
162 'pseudoconstant' => array(
163 'table' => 'civicrm_case_type',
165 'labelColumn' => 'title',
168 'case_subject' => array(
170 'type' => CRM_Utils_Type
::T_STRING
,
171 'title' => ts('Case Subject') ,
172 'description' => 'Short name of the case.',
174 'size' => CRM_Utils_Type
::HUGE
,
176 'where' => 'civicrm_case.subject',
177 'headerPattern' => '',
180 'table_name' => 'civicrm_case',
182 'bao' => 'CRM_Case_BAO_Case',
187 'case_start_date' => array(
188 'name' => 'start_date',
189 'type' => CRM_Utils_Type
::T_DATE
,
190 'title' => ts('Case Start Date') ,
191 'description' => 'Date on which given case starts.',
193 'where' => 'civicrm_case.start_date',
194 'headerPattern' => '',
197 'table_name' => 'civicrm_case',
199 'bao' => 'CRM_Case_BAO_Case',
201 'type' => 'Select Date',
204 'case_end_date' => array(
205 'name' => 'end_date',
206 'type' => CRM_Utils_Type
::T_DATE
,
207 'title' => ts('Case End Date') ,
208 'description' => 'Date on which given case ends.',
210 'where' => 'civicrm_case.end_date',
211 'headerPattern' => '',
214 'table_name' => 'civicrm_case',
216 'bao' => 'CRM_Case_BAO_Case',
218 'type' => 'Select Date',
223 'type' => CRM_Utils_Type
::T_TEXT
,
224 'title' => ts('Details') ,
225 'description' => 'Details about the meeting (agenda, notes, etc).',
228 'table_name' => 'civicrm_case',
230 'bao' => 'CRM_Case_BAO_Case',
232 'type' => 'TextArea',
235 'case_status_id' => array(
236 'name' => 'status_id',
237 'type' => CRM_Utils_Type
::T_INT
,
238 'title' => ts('Case Status') ,
239 'description' => 'Id of case status.',
242 'where' => 'civicrm_case.status_id',
243 'headerPattern' => '',
246 'table_name' => 'civicrm_case',
248 'bao' => 'CRM_Case_BAO_Case',
252 'pseudoconstant' => array(
253 'optionGroupName' => 'case_status',
254 'optionEditPath' => 'civicrm/admin/options/case_status',
257 'case_deleted' => array(
258 'name' => 'is_deleted',
259 'type' => CRM_Utils_Type
::T_BOOLEAN
,
260 'title' => ts('Case is in the Trash') ,
262 'where' => 'civicrm_case.is_deleted',
263 'headerPattern' => '',
266 'table_name' => 'civicrm_case',
268 'bao' => 'CRM_Case_BAO_Case',
271 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
273 return Civi
::$statics[__CLASS__
]['fields'];
276 * Return a mapping from field-name to the corresponding key (as used in fields()).
279 * Array(string $name => string $uniqueName).
281 static function &fieldKeys() {
282 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
283 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
285 return Civi
::$statics[__CLASS__
]['fieldKeys'];
288 * Returns the names of this table
292 static function getTableName() {
293 return self
::$_tableName;
296 * Returns if this table needs to be logged
304 * Returns the list of fields that can be imported
306 * @param bool $prefix
310 static function &import($prefix = false) {
311 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'case', $prefix, array());
315 * Returns the list of fields that can be exported
317 * @param bool $prefix
321 static function &export($prefix = false) {
322 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'case', $prefix, array());