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:260be4cdbe3a79363c3ada3137125c4a)
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 'where' => 'civicrm_location_type.id',
110 'table_name' => 'civicrm_location_type',
111 'entity' => 'LocationType',
112 'bao' => 'CRM_Core_BAO_LocationType',
117 'type' => CRM_Utils_Type
::T_STRING
,
118 'title' => ts('Location Type'),
119 'description' => ts('Location Type Name.'),
121 'size' => CRM_Utils_Type
::BIG
,
122 'where' => 'civicrm_location_type.name',
123 'table_name' => 'civicrm_location_type',
124 'entity' => 'LocationType',
125 'bao' => 'CRM_Core_BAO_LocationType',
129 'name' => 'display_name',
130 'type' => CRM_Utils_Type
::T_STRING
,
131 'title' => ts('Display Name'),
132 'description' => ts('Location Type Display Name.'),
134 'size' => CRM_Utils_Type
::BIG
,
135 'where' => 'civicrm_location_type.display_name',
136 'table_name' => 'civicrm_location_type',
137 'entity' => 'LocationType',
138 'bao' => 'CRM_Core_BAO_LocationType',
142 'name' => 'vcard_name',
143 'type' => CRM_Utils_Type
::T_STRING
,
144 'title' => ts('vCard Location Type'),
145 'description' => ts('vCard Location Type Name.'),
147 'size' => CRM_Utils_Type
::BIG
,
148 'where' => 'civicrm_location_type.vcard_name',
149 'table_name' => 'civicrm_location_type',
150 'entity' => 'LocationType',
151 'bao' => 'CRM_Core_BAO_LocationType',
155 'name' => 'description',
156 'type' => CRM_Utils_Type
::T_STRING
,
157 'title' => ts('Description'),
158 'description' => ts('Location Type Description.'),
160 'size' => CRM_Utils_Type
::HUGE
,
161 'where' => 'civicrm_location_type.description',
162 'table_name' => 'civicrm_location_type',
163 'entity' => 'LocationType',
164 'bao' => 'CRM_Core_BAO_LocationType',
168 'name' => 'is_reserved',
169 'type' => CRM_Utils_Type
::T_BOOLEAN
,
170 'title' => ts('Location Type is Reserved?'),
171 'description' => ts('Is this location type a predefined system location?'),
172 'where' => 'civicrm_location_type.is_reserved',
173 'table_name' => 'civicrm_location_type',
174 'entity' => 'LocationType',
175 'bao' => 'CRM_Core_BAO_LocationType',
179 'name' => 'is_active',
180 'type' => CRM_Utils_Type
::T_BOOLEAN
,
181 'title' => ts('Location Type is Active?'),
182 'description' => ts('Is this property active?'),
183 'where' => 'civicrm_location_type.is_active',
184 'table_name' => 'civicrm_location_type',
185 'entity' => 'LocationType',
186 'bao' => 'CRM_Core_BAO_LocationType',
190 'name' => 'is_default',
191 'type' => CRM_Utils_Type
::T_BOOLEAN
,
192 'title' => ts('Default Location Type?'),
193 'description' => ts('Is this location type the default?'),
194 'where' => 'civicrm_location_type.is_default',
195 'table_name' => 'civicrm_location_type',
196 'entity' => 'LocationType',
197 'bao' => 'CRM_Core_BAO_LocationType',
201 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
203 return Civi
::$statics[__CLASS__
]['fields'];
207 * Return a mapping from field-name to the corresponding key (as used in fields()).
210 * Array(string $name => string $uniqueName).
212 public static function &fieldKeys() {
213 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
214 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
216 return Civi
::$statics[__CLASS__
]['fieldKeys'];
220 * Returns the names of this table
224 public static function getTableName() {
225 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
229 * Returns if this table needs to be logged
233 public function getLog() {
238 * Returns the list of fields that can be imported
240 * @param bool $prefix
244 public static function &import($prefix = FALSE) {
245 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'location_type', $prefix, []);
250 * Returns the list of fields that can be exported
252 * @param bool $prefix
256 public static function &export($prefix = FALSE) {
257 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'location_type', $prefix, []);
262 * Returns the list of indices
264 * @param bool $localize
268 public static function indices($localize = TRUE) {
275 'localizable' => FALSE,
277 'sig' => 'civicrm_location_type::1::name',
280 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;