5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/LocationType.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:06904ebbc78a929b34c17ba1bb580350)
13 * Database access object for the LocationType entity.
15 class CRM_Core_DAO_LocationType
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_location_type';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = TRUE;
46 * Location Type Display Name.
53 * vCard Location Type Name.
60 * Location Type Description.
67 * Is this location type a predefined system location?
74 * Is this property active?
81 * Is this location type the default?
90 public function __construct() {
91 $this->__table
= 'civicrm_location_type';
92 parent
::__construct();
96 * Returns localized title of this entity.
98 public static function getEntityTitle() {
99 return ts('Location Types');
103 * Returns all the column names of this table
107 public static function &fields() {
108 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
109 Civi
::$statics[__CLASS__
]['fields'] = [
112 'type' => CRM_Utils_Type
::T_INT
,
113 'title' => ts('Location Type ID'),
114 'description' => ts('Location Type ID'),
116 'where' => 'civicrm_location_type.id',
117 'table_name' => 'civicrm_location_type',
118 'entity' => 'LocationType',
119 'bao' => 'CRM_Core_BAO_LocationType',
125 'type' => CRM_Utils_Type
::T_STRING
,
126 'title' => ts('Location Type'),
127 'description' => ts('Location Type Name.'),
129 'size' => CRM_Utils_Type
::BIG
,
130 'where' => 'civicrm_location_type.name',
131 'table_name' => 'civicrm_location_type',
132 'entity' => 'LocationType',
133 'bao' => 'CRM_Core_BAO_LocationType',
138 'name' => 'display_name',
139 'type' => CRM_Utils_Type
::T_STRING
,
140 'title' => ts('Display Name'),
141 'description' => ts('Location Type Display Name.'),
143 'size' => CRM_Utils_Type
::BIG
,
144 'where' => 'civicrm_location_type.display_name',
145 'table_name' => 'civicrm_location_type',
146 'entity' => 'LocationType',
147 'bao' => 'CRM_Core_BAO_LocationType',
152 'name' => 'vcard_name',
153 'type' => CRM_Utils_Type
::T_STRING
,
154 'title' => ts('vCard Location Type'),
155 'description' => ts('vCard Location Type Name.'),
157 'size' => CRM_Utils_Type
::BIG
,
158 'where' => 'civicrm_location_type.vcard_name',
159 'table_name' => 'civicrm_location_type',
160 'entity' => 'LocationType',
161 'bao' => 'CRM_Core_BAO_LocationType',
166 'name' => 'description',
167 'type' => CRM_Utils_Type
::T_STRING
,
168 'title' => ts('Description'),
169 'description' => ts('Location Type Description.'),
171 'size' => CRM_Utils_Type
::HUGE
,
172 'where' => 'civicrm_location_type.description',
173 'table_name' => 'civicrm_location_type',
174 'entity' => 'LocationType',
175 'bao' => 'CRM_Core_BAO_LocationType',
180 'name' => 'is_reserved',
181 'type' => CRM_Utils_Type
::T_BOOLEAN
,
182 'title' => ts('Location Type is Reserved?'),
183 'description' => ts('Is this location type a predefined system location?'),
184 'where' => 'civicrm_location_type.is_reserved',
185 'table_name' => 'civicrm_location_type',
186 'entity' => 'LocationType',
187 'bao' => 'CRM_Core_BAO_LocationType',
192 'name' => 'is_active',
193 'type' => CRM_Utils_Type
::T_BOOLEAN
,
194 'title' => ts('Location Type is Active?'),
195 'description' => ts('Is this property active?'),
196 'where' => 'civicrm_location_type.is_active',
197 'table_name' => 'civicrm_location_type',
198 'entity' => 'LocationType',
199 'bao' => 'CRM_Core_BAO_LocationType',
204 'name' => 'is_default',
205 'type' => CRM_Utils_Type
::T_BOOLEAN
,
206 'title' => ts('Default Location Type?'),
207 'description' => ts('Is this location type the default?'),
208 'where' => 'civicrm_location_type.is_default',
209 'table_name' => 'civicrm_location_type',
210 'entity' => 'LocationType',
211 'bao' => 'CRM_Core_BAO_LocationType',
216 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
218 return Civi
::$statics[__CLASS__
]['fields'];
222 * Return a mapping from field-name to the corresponding key (as used in fields()).
225 * Array(string $name => string $uniqueName).
227 public static function &fieldKeys() {
228 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
229 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
231 return Civi
::$statics[__CLASS__
]['fieldKeys'];
235 * Returns the names of this table
239 public static function getTableName() {
240 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
244 * Returns if this table needs to be logged
248 public function getLog() {
253 * Returns the list of fields that can be imported
255 * @param bool $prefix
259 public static function &import($prefix = FALSE) {
260 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'location_type', $prefix, []);
265 * Returns the list of fields that can be exported
267 * @param bool $prefix
271 public static function &export($prefix = FALSE) {
272 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'location_type', $prefix, []);
277 * Returns the list of indices
279 * @param bool $localize
283 public static function indices($localize = TRUE) {
290 'localizable' => FALSE,
292 'sig' => 'civicrm_location_type::1::name',
295 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;