3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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-2015
31 * Generated from xml/schema/CRM/Case/Case.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Case_DAO_Case
extends CRM_Core_DAO
{
38 * static instance to hold the table name
42 static $_tableName = 'civicrm_case';
44 * static instance to hold the field values
48 static $_fields = null;
50 * static instance to hold the keys used in $_fields for each field.
54 static $_fieldKeys = null;
56 * static instance to hold the FK relationships
60 static $_links = null;
62 * static instance to hold the values that can
67 static $_import = null;
69 * static instance to hold the values that can
74 static $_export = null;
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
89 * FK to civicrm_case_type.id
95 * Short name of the case.
101 * Date on which given case starts.
107 * Date on which given case ends.
113 * Details about the meeting (agenda, notes, etc).
132 * @return civicrm_case
134 function __construct() {
135 $this->__table
= 'civicrm_case';
136 parent
::__construct();
139 * Returns foreign keys and entity references
142 * [CRM_Core_Reference_Interface]
144 static function getReferenceColumns() {
145 if (!self
::$_links) {
146 self
::$_links = static ::createReferenceColumns(__CLASS__
);
147 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'case_type_id', 'civicrm_case_type', 'id');
149 return self
::$_links;
152 * Returns all the column names of this table
156 static function &fields() {
157 if (!(self
::$_fields)) {
158 self
::$_fields = array(
161 'type' => CRM_Utils_Type
::T_INT
,
162 'title' => ts('Case ID') ,
163 'description' => 'Unique Case ID',
166 'where' => 'civicrm_case.id',
167 'headerPattern' => '',
171 'case_type_id' => array(
172 'name' => 'case_type_id',
173 'type' => CRM_Utils_Type
::T_INT
,
174 'title' => ts('Case Type') ,
175 'description' => 'FK to civicrm_case_type.id',
177 'where' => 'civicrm_case.case_type_id',
178 'headerPattern' => '',
181 'FKClassName' => 'CRM_Case_DAO_CaseType',
185 'pseudoconstant' => array(
186 'table' => 'civicrm_case_type',
188 'labelColumn' => 'title',
191 'case_subject' => array(
193 'type' => CRM_Utils_Type
::T_STRING
,
194 'title' => ts('Case Subject') ,
195 'description' => 'Short name of the case.',
197 'size' => CRM_Utils_Type
::HUGE
,
199 'where' => 'civicrm_case.subject',
200 'headerPattern' => '',
207 'case_start_date' => array(
208 'name' => 'start_date',
209 'type' => CRM_Utils_Type
::T_DATE
,
210 'title' => ts('Case Start Date') ,
211 'description' => 'Date on which given case starts.',
213 'where' => 'civicrm_case.start_date',
214 'headerPattern' => '',
218 'type' => 'Select Date',
221 'case_end_date' => array(
222 'name' => 'end_date',
223 'type' => CRM_Utils_Type
::T_DATE
,
224 'title' => ts('Case End Date') ,
225 'description' => 'Date on which given case ends.',
227 'where' => 'civicrm_case.end_date',
228 'headerPattern' => '',
232 'type' => 'Select Date',
237 'type' => CRM_Utils_Type
::T_TEXT
,
238 'title' => ts('Details') ,
239 'description' => 'Details about the meeting (agenda, notes, etc).',
243 'type' => 'TextArea',
246 'case_status_id' => array(
247 'name' => 'status_id',
248 'type' => CRM_Utils_Type
::T_INT
,
249 'title' => ts('Case Status') ,
250 'description' => 'Id of case status.',
253 'where' => 'civicrm_case.status_id',
254 'headerPattern' => '',
260 'pseudoconstant' => array(
261 'optionGroupName' => 'case_status',
262 'optionEditPath' => 'civicrm/admin/options/case_status',
265 'case_deleted' => array(
266 'name' => 'is_deleted',
267 'type' => CRM_Utils_Type
::T_BOOLEAN
,
268 'title' => ts('Case is in the Trash') ,
270 'where' => 'civicrm_case.is_deleted',
271 'headerPattern' => '',
277 return self
::$_fields;
280 * Returns an array containing, for each field, the arary key used for that
281 * field in self::$_fields.
285 static function &fieldKeys() {
286 if (!(self
::$_fieldKeys)) {
287 self
::$_fieldKeys = array(
289 'case_type_id' => 'case_type_id',
290 'subject' => 'case_subject',
291 'start_date' => 'case_start_date',
292 'end_date' => 'case_end_date',
293 'details' => 'details',
294 'status_id' => 'case_status_id',
295 'is_deleted' => 'case_deleted',
298 return self
::$_fieldKeys;
301 * Returns the names of this table
305 static function getTableName() {
306 return self
::$_tableName;
309 * Returns if this table needs to be logged
317 * Returns the list of fields that can be imported
319 * @param bool $prefix
323 static function &import($prefix = false) {
324 if (!(self
::$_import)) {
325 self
::$_import = array();
326 $fields = self
::fields();
327 foreach($fields as $name => $field) {
328 if (CRM_Utils_Array
::value('import', $field)) {
330 self
::$_import['case'] = & $fields[$name];
332 self
::$_import[$name] = & $fields[$name];
337 return self
::$_import;
340 * Returns the list of fields that can be exported
342 * @param bool $prefix
346 static function &export($prefix = false) {
347 if (!(self
::$_export)) {
348 self
::$_export = array();
349 $fields = self
::fields();
350 foreach($fields as $name => $field) {
351 if (CRM_Utils_Array
::value('export', $field)) {
353 self
::$_export['case'] = & $fields[$name];
355 self
::$_export[$name] = & $fields[$name];
360 return self
::$_export;