Merge pull request #8916 from cividesk/CRM-19256-4.7
[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
437fafcf 33 * (GenCodeChecksum:f0327e335eb583862d2bd8afad6444ac)
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,
122 ) ,
123 'name' => array(
124 'name' => 'name',
125 'type' => CRM_Utils_Type::T_STRING,
126 'title' => ts('Location Type') ,
127 'description' => 'Location Type Name.',
128 'maxlength' => 64,
129 'size' => CRM_Utils_Type::BIG,
130 ) ,
131 'display_name' => array(
132 'name' => 'display_name',
133 'type' => CRM_Utils_Type::T_STRING,
134 'title' => ts('Display Name') ,
135 'description' => 'Location Type Display Name.',
136 'maxlength' => 64,
137 'size' => CRM_Utils_Type::BIG,
138 ) ,
139 'vcard_name' => array(
140 'name' => 'vcard_name',
141 'type' => CRM_Utils_Type::T_STRING,
142 'title' => ts('vCard Location Type') ,
143 'description' => 'vCard Location Type Name.',
144 'maxlength' => 64,
145 'size' => CRM_Utils_Type::BIG,
146 ) ,
147 'description' => array(
148 'name' => 'description',
149 'type' => CRM_Utils_Type::T_STRING,
150 'title' => ts('Description') ,
151 'description' => 'Location Type Description.',
152 'maxlength' => 255,
153 'size' => CRM_Utils_Type::HUGE,
154 ) ,
155 'is_reserved' => array(
156 'name' => 'is_reserved',
157 'type' => CRM_Utils_Type::T_BOOLEAN,
158 'title' => ts('Location Type is Reserved?') ,
159 'description' => 'Is this location type a predefined system location?',
160 ) ,
161 'is_active' => array(
162 'name' => 'is_active',
163 'type' => CRM_Utils_Type::T_BOOLEAN,
164 'title' => ts('Location Type is Active?') ,
165 'description' => 'Is this property active?',
166 ) ,
167 'is_default' => array(
168 'name' => 'is_default',
169 'type' => CRM_Utils_Type::T_BOOLEAN,
170 'title' => ts('Default Location Type?') ,
171 'description' => 'Is this location type the default?',
172 ) ,
173 );
346aaaba 174 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 175 }
346aaaba 176 return Civi::$statics[__CLASS__]['fields'];
e501603b
TO
177 }
178 /**
bd8e0b14 179 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
180 *
181 * @return array
bd8e0b14 182 * Array(string $name => string $uniqueName).
e501603b
TO
183 */
184 static function &fieldKeys() {
bd8e0b14
TO
185 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
186 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 187 }
bd8e0b14 188 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b
TO
189 }
190 /**
191 * Returns the names of this table
192 *
193 * @return string
194 */
195 static function getTableName() {
196 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
197 }
198 /**
199 * Returns if this table needs to be logged
200 *
201 * @return boolean
202 */
203 function getLog() {
204 return self::$_log;
205 }
206 /**
207 * Returns the list of fields that can be imported
208 *
209 * @param bool $prefix
210 *
211 * @return array
212 */
213 static function &import($prefix = false) {
60808919
TO
214 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'location_type', $prefix, array());
215 return $r;
e501603b
TO
216 }
217 /**
218 * Returns the list of fields that can be exported
219 *
220 * @param bool $prefix
221 *
222 * @return array
223 */
224 static function &export($prefix = false) {
60808919
TO
225 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'location_type', $prefix, array());
226 return $r;
e501603b
TO
227 }
228}