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:b2109f10fffdacf38527863979dee49d)
13 * Database access object for the LocationType entity.
15 class CRM_Core_DAO_LocationType
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.1';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_location_type';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = TRUE;
48 * Location Type Display Name.
55 * vCard Location Type Name.
62 * Location Type Description.
69 * Is this location type a predefined system location?
76 * Is this property active?
83 * Is this location type the default?
92 public function __construct() {
93 $this->__table
= 'civicrm_location_type';
94 parent
::__construct();
98 * Returns localized title of this entity.
100 * @param bool $plural
101 * Whether to return the plural version of the title.
103 public static function getEntityTitle($plural = FALSE) {
104 return $plural ?
ts('Location Types') : ts('Location Type');
108 * Returns all the column names of this table
112 public static function &fields() {
113 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
114 Civi
::$statics[__CLASS__
]['fields'] = [
117 'type' => CRM_Utils_Type
::T_INT
,
118 'title' => ts('Location Type ID'),
119 'description' => ts('Location Type ID'),
121 'where' => 'civicrm_location_type.id',
122 'table_name' => 'civicrm_location_type',
123 'entity' => 'LocationType',
124 'bao' => 'CRM_Core_BAO_LocationType',
134 'type' => CRM_Utils_Type
::T_STRING
,
135 'title' => ts('Location Type'),
136 'description' => ts('Location Type Name.'),
138 'size' => CRM_Utils_Type
::BIG
,
139 'where' => 'civicrm_location_type.name',
140 'table_name' => 'civicrm_location_type',
141 'entity' => 'LocationType',
142 'bao' => 'CRM_Core_BAO_LocationType',
147 'name' => 'display_name',
148 'type' => CRM_Utils_Type
::T_STRING
,
149 'title' => ts('Display Name'),
150 'description' => ts('Location Type Display Name.'),
152 'size' => CRM_Utils_Type
::BIG
,
153 'where' => 'civicrm_location_type.display_name',
154 'table_name' => 'civicrm_location_type',
155 'entity' => 'LocationType',
156 'bao' => 'CRM_Core_BAO_LocationType',
161 'name' => 'vcard_name',
162 'type' => CRM_Utils_Type
::T_STRING
,
163 'title' => ts('vCard Location Type'),
164 'description' => ts('vCard Location Type Name.'),
166 'size' => CRM_Utils_Type
::BIG
,
167 'where' => 'civicrm_location_type.vcard_name',
168 'table_name' => 'civicrm_location_type',
169 'entity' => 'LocationType',
170 'bao' => 'CRM_Core_BAO_LocationType',
175 'name' => 'description',
176 'type' => CRM_Utils_Type
::T_STRING
,
177 'title' => ts('Description'),
178 'description' => ts('Location Type Description.'),
180 'size' => CRM_Utils_Type
::HUGE
,
181 'where' => 'civicrm_location_type.description',
182 'table_name' => 'civicrm_location_type',
183 'entity' => 'LocationType',
184 'bao' => 'CRM_Core_BAO_LocationType',
187 'label' => ts("Description"),
192 'name' => 'is_reserved',
193 'type' => CRM_Utils_Type
::T_BOOLEAN
,
194 'title' => ts('Location Type is Reserved?'),
195 'description' => ts('Is this location type a predefined system location?'),
196 'where' => 'civicrm_location_type.is_reserved',
197 'table_name' => 'civicrm_location_type',
198 'entity' => 'LocationType',
199 'bao' => 'CRM_Core_BAO_LocationType',
204 'name' => 'is_active',
205 'type' => CRM_Utils_Type
::T_BOOLEAN
,
206 'title' => ts('Location Type is Active?'),
207 'description' => ts('Is this property active?'),
208 'where' => 'civicrm_location_type.is_active',
209 'table_name' => 'civicrm_location_type',
210 'entity' => 'LocationType',
211 'bao' => 'CRM_Core_BAO_LocationType',
216 'name' => 'is_default',
217 'type' => CRM_Utils_Type
::T_BOOLEAN
,
218 'title' => ts('Default Location Type?'),
219 'description' => ts('Is this location type the default?'),
220 'where' => 'civicrm_location_type.is_default',
221 'table_name' => 'civicrm_location_type',
222 'entity' => 'LocationType',
223 'bao' => 'CRM_Core_BAO_LocationType',
228 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
230 return Civi
::$statics[__CLASS__
]['fields'];
234 * Return a mapping from field-name to the corresponding key (as used in fields()).
237 * Array(string $name => string $uniqueName).
239 public static function &fieldKeys() {
240 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
241 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
243 return Civi
::$statics[__CLASS__
]['fieldKeys'];
247 * Returns the names of this table
251 public static function getTableName() {
252 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
256 * Returns if this table needs to be logged
260 public function getLog() {
265 * Returns the list of fields that can be imported
267 * @param bool $prefix
271 public static function &import($prefix = FALSE) {
272 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'location_type', $prefix, []);
277 * Returns the list of fields that can be exported
279 * @param bool $prefix
283 public static function &export($prefix = FALSE) {
284 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'location_type', $prefix, []);
289 * Returns the list of indices
291 * @param bool $localize
295 public static function indices($localize = TRUE) {
302 'localizable' => FALSE,
304 'sig' => 'civicrm_location_type::1::name',
307 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;