commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / civicrm / CRM / Core / DAO / LocationType.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2015 |
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-2015
30 *
31 * Generated from xml/schema/CRM/Core/LocationType.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 */
34 require_once 'CRM/Core/DAO.php';
35 require_once 'CRM/Utils/Type.php';
36 class CRM_Core_DAO_LocationType extends CRM_Core_DAO {
37 /**
38 * static instance to hold the table name
39 *
40 * @var string
41 */
42 static $_tableName = 'civicrm_location_type';
43 /**
44 * static instance to hold the field values
45 *
46 * @var array
47 */
48 static $_fields = null;
49 /**
50 * static instance to hold the keys used in $_fields for each field.
51 *
52 * @var array
53 */
54 static $_fieldKeys = null;
55 /**
56 * static instance to hold the FK relationships
57 *
58 * @var string
59 */
60 static $_links = null;
61 /**
62 * static instance to hold the values that can
63 * be imported
64 *
65 * @var array
66 */
67 static $_import = null;
68 /**
69 * static instance to hold the values that can
70 * be exported
71 *
72 * @var array
73 */
74 static $_export = null;
75 /**
76 * static value to see if we should log any modifications to
77 * this table in the civicrm_log table
78 *
79 * @var boolean
80 */
81 static $_log = true;
82 /**
83 * Location Type ID
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * Location Type Name.
90 *
91 * @var string
92 */
93 public $name;
94 /**
95 * Location Type Display Name.
96 *
97 * @var string
98 */
99 public $display_name;
100 /**
101 * vCard Location Type Name.
102 *
103 * @var string
104 */
105 public $vcard_name;
106 /**
107 * Location Type Description.
108 *
109 * @var string
110 */
111 public $description;
112 /**
113 * Is this location type a predefined system location?
114 *
115 * @var boolean
116 */
117 public $is_reserved;
118 /**
119 * Is this property active?
120 *
121 * @var boolean
122 */
123 public $is_active;
124 /**
125 * Is this location type the default?
126 *
127 * @var boolean
128 */
129 public $is_default;
130 /**
131 * class constructor
132 *
133 * @return civicrm_location_type
134 */
135 function __construct() {
136 $this->__table = 'civicrm_location_type';
137 parent::__construct();
138 }
139 /**
140 * Returns all the column names of this table
141 *
142 * @return array
143 */
144 static function &fields() {
145 if (!(self::$_fields)) {
146 self::$_fields = array(
147 'id' => array(
148 'name' => 'id',
149 'type' => CRM_Utils_Type::T_INT,
150 'title' => ts('Location Type ID') ,
151 'description' => 'Location Type ID',
152 'required' => true,
153 ) ,
154 'name' => array(
155 'name' => 'name',
156 'type' => CRM_Utils_Type::T_STRING,
157 'title' => ts('Location Type') ,
158 'description' => 'Location Type Name.',
159 'maxlength' => 64,
160 'size' => CRM_Utils_Type::BIG,
161 ) ,
162 'display_name' => array(
163 'name' => 'display_name',
164 'type' => CRM_Utils_Type::T_STRING,
165 'title' => ts('Display Name') ,
166 'description' => 'Location Type Display Name.',
167 'maxlength' => 64,
168 'size' => CRM_Utils_Type::BIG,
169 ) ,
170 'vcard_name' => array(
171 'name' => 'vcard_name',
172 'type' => CRM_Utils_Type::T_STRING,
173 'title' => ts('vCard Location Type') ,
174 'description' => 'vCard Location Type Name.',
175 'maxlength' => 64,
176 'size' => CRM_Utils_Type::BIG,
177 ) ,
178 'description' => array(
179 'name' => 'description',
180 'type' => CRM_Utils_Type::T_STRING,
181 'title' => ts('Description') ,
182 'description' => 'Location Type Description.',
183 'maxlength' => 255,
184 'size' => CRM_Utils_Type::HUGE,
185 ) ,
186 'is_reserved' => array(
187 'name' => 'is_reserved',
188 'type' => CRM_Utils_Type::T_BOOLEAN,
189 'title' => ts('Location Type is Reserved?') ,
190 'description' => 'Is this location type a predefined system location?',
191 ) ,
192 'is_active' => array(
193 'name' => 'is_active',
194 'type' => CRM_Utils_Type::T_BOOLEAN,
195 'title' => ts('Location Type is Active?') ,
196 'description' => 'Is this property active?',
197 ) ,
198 'is_default' => array(
199 'name' => 'is_default',
200 'type' => CRM_Utils_Type::T_BOOLEAN,
201 'title' => ts('Default Location Type?') ,
202 'description' => 'Is this location type the default?',
203 ) ,
204 );
205 }
206 return self::$_fields;
207 }
208 /**
209 * Returns an array containing, for each field, the arary key used for that
210 * field in self::$_fields.
211 *
212 * @return array
213 */
214 static function &fieldKeys() {
215 if (!(self::$_fieldKeys)) {
216 self::$_fieldKeys = array(
217 'id' => 'id',
218 'name' => 'name',
219 'display_name' => 'display_name',
220 'vcard_name' => 'vcard_name',
221 'description' => 'description',
222 'is_reserved' => 'is_reserved',
223 'is_active' => 'is_active',
224 'is_default' => 'is_default',
225 );
226 }
227 return self::$_fieldKeys;
228 }
229 /**
230 * Returns the names of this table
231 *
232 * @return string
233 */
234 static function getTableName() {
235 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
236 }
237 /**
238 * Returns if this table needs to be logged
239 *
240 * @return boolean
241 */
242 function getLog() {
243 return self::$_log;
244 }
245 /**
246 * Returns the list of fields that can be imported
247 *
248 * @param bool $prefix
249 *
250 * @return array
251 */
252 static function &import($prefix = false) {
253 if (!(self::$_import)) {
254 self::$_import = array();
255 $fields = self::fields();
256 foreach($fields as $name => $field) {
257 if (CRM_Utils_Array::value('import', $field)) {
258 if ($prefix) {
259 self::$_import['location_type'] = & $fields[$name];
260 } else {
261 self::$_import[$name] = & $fields[$name];
262 }
263 }
264 }
265 }
266 return self::$_import;
267 }
268 /**
269 * Returns the list of fields that can be exported
270 *
271 * @param bool $prefix
272 *
273 * @return array
274 */
275 static function &export($prefix = false) {
276 if (!(self::$_export)) {
277 self::$_export = array();
278 $fields = self::fields();
279 foreach($fields as $name => $field) {
280 if (CRM_Utils_Array::value('export', $field)) {
281 if ($prefix) {
282 self::$_export['location_type'] = & $fields[$name];
283 } else {
284 self::$_export[$name] = & $fields[$name];
285 }
286 }
287 }
288 }
289 return self::$_export;
290 }
291 }