5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/LocationType.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:a97cc190a4fbeafa8846f48f47dcd63e)
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 all the column names of this table
100 public static function &fields() {
101 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
102 Civi
::$statics[__CLASS__
]['fields'] = [
105 'type' => CRM_Utils_Type
::T_INT
,
106 'title' => ts('Location Type ID'),
107 'description' => ts('Location Type ID'),
109 'table_name' => 'civicrm_location_type',
110 'entity' => 'LocationType',
111 'bao' => 'CRM_Core_BAO_LocationType',
116 'type' => CRM_Utils_Type
::T_STRING
,
117 'title' => ts('Location Type'),
118 'description' => ts('Location Type Name.'),
120 'size' => CRM_Utils_Type
::BIG
,
121 'table_name' => 'civicrm_location_type',
122 'entity' => 'LocationType',
123 'bao' => 'CRM_Core_BAO_LocationType',
127 'name' => 'display_name',
128 'type' => CRM_Utils_Type
::T_STRING
,
129 'title' => ts('Display Name'),
130 'description' => ts('Location Type Display Name.'),
132 'size' => CRM_Utils_Type
::BIG
,
133 'table_name' => 'civicrm_location_type',
134 'entity' => 'LocationType',
135 'bao' => 'CRM_Core_BAO_LocationType',
139 'name' => 'vcard_name',
140 'type' => CRM_Utils_Type
::T_STRING
,
141 'title' => ts('vCard Location Type'),
142 'description' => ts('vCard Location Type Name.'),
144 'size' => CRM_Utils_Type
::BIG
,
145 'table_name' => 'civicrm_location_type',
146 'entity' => 'LocationType',
147 'bao' => 'CRM_Core_BAO_LocationType',
151 'name' => 'description',
152 'type' => CRM_Utils_Type
::T_STRING
,
153 'title' => ts('Description'),
154 'description' => ts('Location Type Description.'),
156 'size' => CRM_Utils_Type
::HUGE
,
157 'table_name' => 'civicrm_location_type',
158 'entity' => 'LocationType',
159 'bao' => 'CRM_Core_BAO_LocationType',
163 'name' => 'is_reserved',
164 'type' => CRM_Utils_Type
::T_BOOLEAN
,
165 'title' => ts('Location Type is Reserved?'),
166 'description' => ts('Is this location type a predefined system location?'),
167 'table_name' => 'civicrm_location_type',
168 'entity' => 'LocationType',
169 'bao' => 'CRM_Core_BAO_LocationType',
173 'name' => 'is_active',
174 'type' => CRM_Utils_Type
::T_BOOLEAN
,
175 'title' => ts('Location Type is Active?'),
176 'description' => ts('Is this property active?'),
177 'table_name' => 'civicrm_location_type',
178 'entity' => 'LocationType',
179 'bao' => 'CRM_Core_BAO_LocationType',
183 'name' => 'is_default',
184 'type' => CRM_Utils_Type
::T_BOOLEAN
,
185 'title' => ts('Default Location Type?'),
186 'description' => ts('Is this location type the default?'),
187 'table_name' => 'civicrm_location_type',
188 'entity' => 'LocationType',
189 'bao' => 'CRM_Core_BAO_LocationType',
193 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
195 return Civi
::$statics[__CLASS__
]['fields'];
199 * Return a mapping from field-name to the corresponding key (as used in fields()).
202 * Array(string $name => string $uniqueName).
204 public static function &fieldKeys() {
205 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
206 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
208 return Civi
::$statics[__CLASS__
]['fieldKeys'];
212 * Returns the names of this table
216 public static function getTableName() {
217 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
221 * Returns if this table needs to be logged
225 public function getLog() {
230 * Returns the list of fields that can be imported
232 * @param bool $prefix
236 public static function &import($prefix = FALSE) {
237 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'location_type', $prefix, []);
242 * Returns the list of fields that can be exported
244 * @param bool $prefix
248 public static function &export($prefix = FALSE) {
249 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'location_type', $prefix, []);
254 * Returns the list of indices
256 * @param bool $localize
260 public static function indices($localize = TRUE) {
267 'localizable' => FALSE,
269 'sig' => 'civicrm_location_type::1::name',
272 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;