fixup CRM-14885 - Import DAOs
[civicrm-core.git] / CRM / Contact / DAO / ContactType.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
6| Copyright CiviCRM LLC (c) 2004-2016 |
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-2016
30 *
31 * Generated from xml/schema/CRM/Contact/ContactType.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
437fafcf 33 * (GenCodeChecksum:5cd581b1cd8b3dc4f942b1612a1daff0)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
37class CRM_Contact_DAO_ContactType extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_contact_type';
44 /**
45 * static instance to hold the field values
46 *
47 * @var array
48 */
49 static $_fields = null;
50 /**
51 * static instance to hold the keys used in $_fields for each field.
52 *
53 * @var array
54 */
55 static $_fieldKeys = null;
56 /**
57 * static instance to hold the FK relationships
58 *
59 * @var string
60 */
61 static $_links = null;
62 /**
63 * static instance to hold the values that can
64 * be imported
65 *
66 * @var array
67 */
68 static $_import = null;
69 /**
70 * static instance to hold the values that can
71 * be exported
72 *
73 * @var array
74 */
75 static $_export = null;
76 /**
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
79 *
80 * @var boolean
81 */
82 static $_log = false;
83 /**
84 * Contact Type ID
85 *
86 * @var int unsigned
87 */
88 public $id;
89 /**
90 * Internal name of Contact Type (or Subtype).
91 *
92 * @var string
93 */
94 public $name;
95 /**
96 * localized Name of Contact Type.
97 *
98 * @var string
99 */
100 public $label;
101 /**
102 * localized Optional verbose description of the type.
103 *
104 * @var text
105 */
106 public $description;
107 /**
108 * URL of image if any.
109 *
110 * @var string
111 */
112 public $image_URL;
113 /**
114 * Optional FK to parent contact type.
115 *
116 * @var int unsigned
117 */
118 public $parent_id;
119 /**
120 * Is this entry active?
121 *
122 * @var boolean
123 */
124 public $is_active;
125 /**
126 * Is this contact type a predefined system type
127 *
128 * @var boolean
129 */
130 public $is_reserved;
131 /**
132 * class constructor
133 *
134 * @return civicrm_contact_type
135 */
136 function __construct() {
137 $this->__table = 'civicrm_contact_type';
138 parent::__construct();
139 }
140 /**
141 * Returns foreign keys and entity references
142 *
143 * @return array
144 * [CRM_Core_Reference_Interface]
145 */
146 static function getReferenceColumns() {
147 if (!self::$_links) {
148 self::$_links = static ::createReferenceColumns(__CLASS__);
149 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'parent_id', 'civicrm_contact_type', 'id');
150 }
151 return self::$_links;
152 }
153 /**
154 * Returns all the column names of this table
155 *
156 * @return array
157 */
158 static function &fields() {
159 if (!(self::$_fields)) {
160 self::$_fields = array(
161 'id' => array(
162 'name' => 'id',
163 'type' => CRM_Utils_Type::T_INT,
164 'title' => ts('Contact Type ID') ,
165 'description' => 'Contact Type ID',
166 'required' => true,
167 ) ,
168 'name' => array(
169 'name' => 'name',
170 'type' => CRM_Utils_Type::T_STRING,
171 'title' => ts('Name') ,
172 'description' => 'Internal name of Contact Type (or Subtype).',
173 'maxlength' => 64,
174 'size' => CRM_Utils_Type::BIG,
175 ) ,
176 'label' => array(
177 'name' => 'label',
178 'type' => CRM_Utils_Type::T_STRING,
179 'title' => ts('Contact Type Label') ,
180 'description' => 'localized Name of Contact Type.',
181 'maxlength' => 64,
182 'size' => CRM_Utils_Type::BIG,
183 ) ,
184 'description' => array(
185 'name' => 'description',
186 'type' => CRM_Utils_Type::T_TEXT,
187 'title' => ts('Contact Type Description') ,
188 'description' => 'localized Optional verbose description of the type.',
189 'rows' => 2,
190 'cols' => 60,
191 'html' => array(
192 'type' => 'TextArea',
193 ) ,
194 ) ,
195 'image_URL' => array(
196 'name' => 'image_URL',
197 'type' => CRM_Utils_Type::T_STRING,
198 'title' => ts('Contact Type Image URL') ,
199 'description' => 'URL of image if any.',
200 'maxlength' => 255,
201 'size' => CRM_Utils_Type::HUGE,
202 ) ,
203 'parent_id' => array(
204 'name' => 'parent_id',
205 'type' => CRM_Utils_Type::T_INT,
206 'title' => ts('Contact Type Parent') ,
207 'description' => 'Optional FK to parent contact type.',
208 'FKClassName' => 'CRM_Contact_DAO_ContactType',
209 'pseudoconstant' => array(
210 'table' => 'civicrm_contact_type',
211 'keyColumn' => 'id',
212 'labelColumn' => 'label',
213 'condition' => 'parent_id IS NULL',
214 )
215 ) ,
216 'is_active' => array(
217 'name' => 'is_active',
218 'type' => CRM_Utils_Type::T_BOOLEAN,
219 'title' => ts('Contact Type Is Active?') ,
220 'description' => 'Is this entry active?',
221 ) ,
222 'is_reserved' => array(
223 'name' => 'is_reserved',
224 'type' => CRM_Utils_Type::T_BOOLEAN,
225 'title' => ts('Contact Type is Reserved?') ,
226 'description' => 'Is this contact type a predefined system type',
227 ) ,
228 );
229 }
230 return self::$_fields;
231 }
232 /**
233 * Returns an array containing, for each field, the arary key used for that
234 * field in self::$_fields.
235 *
236 * @return array
237 */
238 static function &fieldKeys() {
239 if (!(self::$_fieldKeys)) {
240 self::$_fieldKeys = array(
241 'id' => 'id',
242 'name' => 'name',
243 'label' => 'label',
244 'description' => 'description',
245 'image_URL' => 'image_URL',
246 'parent_id' => 'parent_id',
247 'is_active' => 'is_active',
248 'is_reserved' => 'is_reserved',
249 );
250 }
251 return self::$_fieldKeys;
252 }
253 /**
254 * Returns the names of this table
255 *
256 * @return string
257 */
258 static function getTableName() {
259 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
260 }
261 /**
262 * Returns if this table needs to be logged
263 *
264 * @return boolean
265 */
266 function getLog() {
267 return self::$_log;
268 }
269 /**
270 * Returns the list of fields that can be imported
271 *
272 * @param bool $prefix
273 *
274 * @return array
275 */
276 static function &import($prefix = false) {
277 if (!(self::$_import)) {
278 self::$_import = array();
279 $fields = self::fields();
280 foreach($fields as $name => $field) {
281 if (CRM_Utils_Array::value('import', $field)) {
282 if ($prefix) {
283 self::$_import['contact_type'] = & $fields[$name];
284 } else {
285 self::$_import[$name] = & $fields[$name];
286 }
287 }
288 }
289 }
290 return self::$_import;
291 }
292 /**
293 * Returns the list of fields that can be exported
294 *
295 * @param bool $prefix
296 *
297 * @return array
298 */
299 static function &export($prefix = false) {
300 if (!(self::$_export)) {
301 self::$_export = array();
302 $fields = self::fields();
303 foreach($fields as $name => $field) {
304 if (CRM_Utils_Array::value('export', $field)) {
305 if ($prefix) {
306 self::$_export['contact_type'] = & $fields[$name];
307 } else {
308 self::$_export[$name] = & $fields[$name];
309 }
310 }
311 }
312 }
313 return self::$_export;
314 }
315}