Merge pull request #9566 from totten/master-19690-layout
[civicrm-core.git] / CRM / Case / DAO / CaseType.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2017
30 *
31 * Generated from xml/schema/CRM/Case/CaseType.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:b7ed773542d2b9e4016e073dac6c70b3)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Case_DAO_CaseType extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_case_type';
44 /**
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
47 *
48 * @var boolean
49 */
50 static $_log = true;
51 /**
52 * Autoincremented type id
53 *
54 * @var int unsigned
55 */
56 public $id;
57 /**
58 * Machine name for Case Type
59 *
60 * @var string
61 */
62 public $name;
63 /**
64 * Natural language name for Case Type
65 *
66 * @var string
67 */
68 public $title;
69 /**
70 * Description of the Case Type
71 *
72 * @var string
73 */
74 public $description;
75 /**
76 * Is this entry active?
77 *
78 * @var boolean
79 */
80 public $is_active;
81 /**
82 * Is this case type a predefined system type?
83 *
84 * @var boolean
85 */
86 public $is_reserved;
87 /**
88 * Ordering of the case types
89 *
90 * @var int
91 */
92 public $weight;
93 /**
94 * xml definition of case type
95 *
96 * @var blob
97 */
98 public $definition;
99 /**
100 * class constructor
101 *
102 * @return civicrm_case_type
103 */
104 function __construct() {
105 $this->__table = 'civicrm_case_type';
106 parent::__construct();
107 }
108 /**
109 * Returns all the column names of this table
110 *
111 * @return array
112 */
113 static function &fields() {
114 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
115 Civi::$statics[__CLASS__]['fields'] = array(
116 'id' => array(
117 'name' => 'id',
118 'type' => CRM_Utils_Type::T_INT,
119 'title' => ts('Case Type ID') ,
120 'description' => 'Autoincremented type id',
121 'required' => true,
122 ) ,
123 'name' => array(
124 'name' => 'name',
125 'type' => CRM_Utils_Type::T_STRING,
126 'title' => ts('Case Type Name') ,
127 'description' => 'Machine name for Case Type',
128 'required' => true,
129 'maxlength' => 64,
130 'size' => CRM_Utils_Type::BIG,
131 ) ,
132 'title' => array(
133 'name' => 'title',
134 'type' => CRM_Utils_Type::T_STRING,
135 'title' => ts('Case Type Title') ,
136 'description' => 'Natural language name for Case Type',
137 'required' => true,
138 'maxlength' => 64,
139 'size' => CRM_Utils_Type::BIG,
140 ) ,
141 'description' => array(
142 'name' => 'description',
143 'type' => CRM_Utils_Type::T_STRING,
144 'title' => ts('Case Type Description') ,
145 'description' => 'Description of the Case Type',
146 'maxlength' => 255,
147 'size' => CRM_Utils_Type::HUGE,
148 ) ,
149 'is_active' => array(
150 'name' => 'is_active',
151 'type' => CRM_Utils_Type::T_BOOLEAN,
152 'title' => ts('Case Type Is Active') ,
153 'description' => 'Is this entry active?',
154 ) ,
155 'is_reserved' => array(
156 'name' => 'is_reserved',
157 'type' => CRM_Utils_Type::T_BOOLEAN,
158 'title' => ts('Case Type Is Reserved') ,
159 'description' => 'Is this case type a predefined system type?',
160 ) ,
161 'weight' => array(
162 'name' => 'weight',
163 'type' => CRM_Utils_Type::T_INT,
164 'title' => ts('Order') ,
165 'description' => 'Ordering of the case types',
166 'required' => true,
167 'default' => '1',
168 ) ,
169 'definition' => array(
170 'name' => 'definition',
171 'type' => CRM_Utils_Type::T_BLOB,
172 'title' => ts('Case Type Definition') ,
173 'description' => 'xml definition of case type',
174 ) ,
175 );
176 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
177 }
178 return Civi::$statics[__CLASS__]['fields'];
179 }
180 /**
181 * Return a mapping from field-name to the corresponding key (as used in fields()).
182 *
183 * @return array
184 * Array(string $name => string $uniqueName).
185 */
186 static function &fieldKeys() {
187 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
188 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
189 }
190 return Civi::$statics[__CLASS__]['fieldKeys'];
191 }
192 /**
193 * Returns the names of this table
194 *
195 * @return string
196 */
197 static function getTableName() {
198 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
199 }
200 /**
201 * Returns if this table needs to be logged
202 *
203 * @return boolean
204 */
205 function getLog() {
206 return self::$_log;
207 }
208 /**
209 * Returns the list of fields that can be imported
210 *
211 * @param bool $prefix
212 *
213 * @return array
214 */
215 static function &import($prefix = false) {
216 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'case_type', $prefix, array());
217 return $r;
218 }
219 /**
220 * Returns the list of fields that can be exported
221 *
222 * @param bool $prefix
223 *
224 * @return array
225 */
226 static function &export($prefix = false) {
227 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'case_type', $prefix, array());
228 return $r;
229 }
230 }