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:0aac55ebb9932e5ab19fcf2e6eca7dd0)
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',
130 'type' => CRM_Utils_Type
::T_STRING
,
131 'title' => ts('Location Type'),
132 'description' => ts('Location Type Name.'),
134 'size' => CRM_Utils_Type
::BIG
,
135 'where' => 'civicrm_location_type.name',
136 'table_name' => 'civicrm_location_type',
137 'entity' => 'LocationType',
138 'bao' => 'CRM_Core_BAO_LocationType',
143 'name' => 'display_name',
144 'type' => CRM_Utils_Type
::T_STRING
,
145 'title' => ts('Display Name'),
146 'description' => ts('Location Type Display Name.'),
148 'size' => CRM_Utils_Type
::BIG
,
149 'where' => 'civicrm_location_type.display_name',
150 'table_name' => 'civicrm_location_type',
151 'entity' => 'LocationType',
152 'bao' => 'CRM_Core_BAO_LocationType',
157 'name' => 'vcard_name',
158 'type' => CRM_Utils_Type
::T_STRING
,
159 'title' => ts('vCard Location Type'),
160 'description' => ts('vCard Location Type Name.'),
162 'size' => CRM_Utils_Type
::BIG
,
163 'where' => 'civicrm_location_type.vcard_name',
164 'table_name' => 'civicrm_location_type',
165 'entity' => 'LocationType',
166 'bao' => 'CRM_Core_BAO_LocationType',
171 'name' => 'description',
172 'type' => CRM_Utils_Type
::T_STRING
,
173 'title' => ts('Description'),
174 'description' => ts('Location Type Description.'),
176 'size' => CRM_Utils_Type
::HUGE
,
177 'where' => 'civicrm_location_type.description',
178 'table_name' => 'civicrm_location_type',
179 'entity' => 'LocationType',
180 'bao' => 'CRM_Core_BAO_LocationType',
185 'name' => 'is_reserved',
186 'type' => CRM_Utils_Type
::T_BOOLEAN
,
187 'title' => ts('Location Type is Reserved?'),
188 'description' => ts('Is this location type a predefined system location?'),
189 'where' => 'civicrm_location_type.is_reserved',
190 'table_name' => 'civicrm_location_type',
191 'entity' => 'LocationType',
192 'bao' => 'CRM_Core_BAO_LocationType',
197 'name' => 'is_active',
198 'type' => CRM_Utils_Type
::T_BOOLEAN
,
199 'title' => ts('Location Type is Active?'),
200 'description' => ts('Is this property active?'),
201 'where' => 'civicrm_location_type.is_active',
202 'table_name' => 'civicrm_location_type',
203 'entity' => 'LocationType',
204 'bao' => 'CRM_Core_BAO_LocationType',
209 'name' => 'is_default',
210 'type' => CRM_Utils_Type
::T_BOOLEAN
,
211 'title' => ts('Default Location Type?'),
212 'description' => ts('Is this location type the default?'),
213 'where' => 'civicrm_location_type.is_default',
214 'table_name' => 'civicrm_location_type',
215 'entity' => 'LocationType',
216 'bao' => 'CRM_Core_BAO_LocationType',
221 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
223 return Civi
::$statics[__CLASS__
]['fields'];
227 * Return a mapping from field-name to the corresponding key (as used in fields()).
230 * Array(string $name => string $uniqueName).
232 public static function &fieldKeys() {
233 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
234 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
236 return Civi
::$statics[__CLASS__
]['fieldKeys'];
240 * Returns the names of this table
244 public static function getTableName() {
245 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
249 * Returns if this table needs to be logged
253 public function getLog() {
258 * Returns the list of fields that can be imported
260 * @param bool $prefix
264 public static function &import($prefix = FALSE) {
265 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'location_type', $prefix, []);
270 * Returns the list of fields that can be exported
272 * @param bool $prefix
276 public static function &export($prefix = FALSE) {
277 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'location_type', $prefix, []);
282 * Returns the list of indices
284 * @param bool $localize
288 public static function indices($localize = TRUE) {
295 'localizable' => FALSE,
297 'sig' => 'civicrm_location_type::1::name',
300 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;