Merge pull request #10549 from jitendrapurohit/CRM-20761
[civicrm-core.git] / CRM / Core / DAO / LocationType.php
CommitLineData
e501603b
TO
1<?php
2/*
3+--------------------------------------------------------------------+
4| CiviCRM version 4.7 |
5+--------------------------------------------------------------------+
0f03f337 6| Copyright CiviCRM LLC (c) 2004-2017 |
e501603b
TO
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
0f03f337 29 * @copyright CiviCRM LLC (c) 2004-2017
e501603b
TO
30 *
31 * Generated from xml/schema/CRM/Core/LocationType.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
e7a6b91a 33 * (GenCodeChecksum:630f891b9d0d1621cdbf3254e8536d4f)
e501603b
TO
34 */
35require_once 'CRM/Core/DAO.php';
36require_once 'CRM/Utils/Type.php';
f41f0342 37/**
38 * CRM_Core_DAO_LocationType constructor.
39 */
e501603b
TO
40class CRM_Core_DAO_LocationType extends CRM_Core_DAO {
41 /**
f41f0342 42 * Static instance to hold the table name.
e501603b
TO
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_location_type';
e501603b 47 /**
f41f0342 48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b
TO
49 *
50 * @var boolean
51 */
52 static $_log = true;
53 /**
54 * Location Type ID
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 * Location Type Name.
61 *
62 * @var string
63 */
64 public $name;
65 /**
66 * Location Type Display Name.
67 *
68 * @var string
69 */
70 public $display_name;
71 /**
72 * vCard Location Type Name.
73 *
74 * @var string
75 */
76 public $vcard_name;
77 /**
78 * Location Type Description.
79 *
80 * @var string
81 */
82 public $description;
83 /**
84 * Is this location type a predefined system location?
85 *
86 * @var boolean
87 */
88 public $is_reserved;
89 /**
90 * Is this property active?
91 *
92 * @var boolean
93 */
94 public $is_active;
95 /**
96 * Is this location type the default?
97 *
98 * @var boolean
99 */
100 public $is_default;
101 /**
f41f0342 102 * Class constructor.
e501603b
TO
103 */
104 function __construct() {
105 $this->__table = 'civicrm_location_type';
106 parent::__construct();
107 }
108 /**
109 * Returns all the column names of this table
110 *
111 * @return array
112 */
113 static function &fields() {
346aaaba
TO
114 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
115 Civi::$statics[__CLASS__]['fields'] = array(
e501603b
TO
116 'id' => array(
117 'name' => 'id',
118 'type' => CRM_Utils_Type::T_INT,
119 'title' => ts('Location Type ID') ,
120 'description' => 'Location Type ID',
121 'required' => true,
522a26c9 122 'table_name' => 'civicrm_location_type',
123 'entity' => 'LocationType',
124 'bao' => 'CRM_Core_BAO_LocationType',
6a7e5e5d 125 'localizable' => 0,
e501603b
TO
126 ) ,
127 'name' => array(
128 'name' => 'name',
129 'type' => CRM_Utils_Type::T_STRING,
130 'title' => ts('Location Type') ,
131 'description' => 'Location Type Name.',
132 'maxlength' => 64,
133 'size' => CRM_Utils_Type::BIG,
522a26c9 134 'table_name' => 'civicrm_location_type',
135 'entity' => 'LocationType',
136 'bao' => 'CRM_Core_BAO_LocationType',
6a7e5e5d 137 'localizable' => 0,
e501603b
TO
138 ) ,
139 'display_name' => array(
140 'name' => 'display_name',
141 'type' => CRM_Utils_Type::T_STRING,
142 'title' => ts('Display Name') ,
143 'description' => 'Location Type Display Name.',
144 'maxlength' => 64,
145 'size' => CRM_Utils_Type::BIG,
522a26c9 146 'table_name' => 'civicrm_location_type',
147 'entity' => 'LocationType',
148 'bao' => 'CRM_Core_BAO_LocationType',
6a7e5e5d 149 'localizable' => 1,
e501603b
TO
150 ) ,
151 'vcard_name' => array(
152 'name' => 'vcard_name',
153 'type' => CRM_Utils_Type::T_STRING,
154 'title' => ts('vCard Location Type') ,
155 'description' => 'vCard Location Type Name.',
156 'maxlength' => 64,
157 'size' => CRM_Utils_Type::BIG,
522a26c9 158 'table_name' => 'civicrm_location_type',
159 'entity' => 'LocationType',
160 'bao' => 'CRM_Core_BAO_LocationType',
6a7e5e5d 161 'localizable' => 0,
e501603b
TO
162 ) ,
163 'description' => array(
164 'name' => 'description',
165 'type' => CRM_Utils_Type::T_STRING,
166 'title' => ts('Description') ,
167 'description' => 'Location Type Description.',
168 'maxlength' => 255,
169 'size' => CRM_Utils_Type::HUGE,
522a26c9 170 'table_name' => 'civicrm_location_type',
171 'entity' => 'LocationType',
172 'bao' => 'CRM_Core_BAO_LocationType',
6a7e5e5d 173 'localizable' => 0,
e501603b
TO
174 ) ,
175 'is_reserved' => array(
176 'name' => 'is_reserved',
177 'type' => CRM_Utils_Type::T_BOOLEAN,
178 'title' => ts('Location Type is Reserved?') ,
179 'description' => 'Is this location type a predefined system location?',
522a26c9 180 'table_name' => 'civicrm_location_type',
181 'entity' => 'LocationType',
182 'bao' => 'CRM_Core_BAO_LocationType',
6a7e5e5d 183 'localizable' => 0,
e501603b
TO
184 ) ,
185 'is_active' => array(
186 'name' => 'is_active',
187 'type' => CRM_Utils_Type::T_BOOLEAN,
188 'title' => ts('Location Type is Active?') ,
189 'description' => 'Is this property active?',
522a26c9 190 'table_name' => 'civicrm_location_type',
191 'entity' => 'LocationType',
192 'bao' => 'CRM_Core_BAO_LocationType',
6a7e5e5d 193 'localizable' => 0,
e501603b
TO
194 ) ,
195 'is_default' => array(
196 'name' => 'is_default',
197 'type' => CRM_Utils_Type::T_BOOLEAN,
198 'title' => ts('Default Location Type?') ,
199 'description' => 'Is this location type the default?',
522a26c9 200 'table_name' => 'civicrm_location_type',
201 'entity' => 'LocationType',
202 'bao' => 'CRM_Core_BAO_LocationType',
6a7e5e5d 203 'localizable' => 0,
e501603b
TO
204 ) ,
205 );
346aaaba 206 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 207 }
346aaaba 208 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
209 }
210 /**
bd8e0b14 211 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
212 *
213 * @return array
bd8e0b14 214 * Array(string $name => string $uniqueName).
e501603b
TO
215 */
216 static function &fieldKeys() {
bd8e0b14
TO
217 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
218 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 219 }
bd8e0b14 220 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
221 }
222 /**
223 * Returns the names of this table
224 *
225 * @return string
226 */
227 static function getTableName() {
228 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
229 }
230 /**
231 * Returns if this table needs to be logged
232 *
233 * @return boolean
234 */
235 function getLog() {
236 return self::$_log;
237 }
238 /**
239 * Returns the list of fields that can be imported
240 *
241 * @param bool $prefix
242 *
243 * @return array
244 */
245 static function &import($prefix = false) {
60808919
TO
246 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'location_type', $prefix, array());
247 return $r;
e501603b
TO
248 }
249 /**
250 * Returns the list of fields that can be exported
251 *
252 * @param bool $prefix
253 *
254 * @return array
255 */
256 static function &export($prefix = false) {
60808919
TO
257 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'location_type', $prefix, array());
258 return $r;
e501603b 259 }
e7a6b91a
AS
260 /**
261 * Returns the list of indices
262 */
263 public static function indices($localize = TRUE) {
264 $indices = array(
265 'UI_name' => array(
266 'name' => 'UI_name',
267 'field' => array(
268 0 => 'name',
269 ) ,
270 'localizable' => false,
271 'unique' => true,
272 'sig' => 'civicrm_location_type::1::name',
273 ) ,
274 );
275 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
276 }
e501603b 277}