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:7bf7552cfdc3988c4582bccaea302c5f)
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;
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
46 * (SQL type: varchar(64))
47 * Note that values will be retrieved from the database as a string.
52 * Location Type Display Name.
55 * (SQL type: varchar(64))
56 * Note that values will be retrieved from the database as a string.
61 * vCard Location Type Name.
64 * (SQL type: varchar(64))
65 * Note that values will be retrieved from the database as a string.
70 * Location Type Description.
73 * (SQL type: varchar(255))
74 * Note that values will be retrieved from the database as a string.
79 * Is this location type a predefined system location?
81 * @var bool|string|null
83 * Note that values will be retrieved from the database as a string.
88 * Is this property active?
90 * @var bool|string|null
92 * Note that values will be retrieved from the database as a string.
97 * Is this location type the default?
99 * @var bool|string|null
100 * (SQL type: tinyint)
101 * Note that values will be retrieved from the database as a string.
108 public function __construct() {
109 $this->__table
= 'civicrm_location_type';
110 parent
::__construct();
114 * Returns localized title of this entity.
116 * @param bool $plural
117 * Whether to return the plural version of the title.
119 public static function getEntityTitle($plural = FALSE) {
120 return $plural ?
ts('Location Types') : ts('Location Type');
124 * Returns all the column names of this table
128 public static function &fields() {
129 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
130 Civi
::$statics[__CLASS__
]['fields'] = [
133 'type' => CRM_Utils_Type
::T_INT
,
134 'title' => ts('Location Type ID'),
135 'description' => ts('Location Type ID'),
137 'where' => 'civicrm_location_type.id',
138 'table_name' => 'civicrm_location_type',
139 'entity' => 'LocationType',
140 'bao' => 'CRM_Core_BAO_LocationType',
150 'type' => CRM_Utils_Type
::T_STRING
,
151 'title' => ts('Location Type'),
152 'description' => ts('Location Type Name.'),
154 'size' => CRM_Utils_Type
::BIG
,
155 'where' => 'civicrm_location_type.name',
156 'table_name' => 'civicrm_location_type',
157 'entity' => 'LocationType',
158 'bao' => 'CRM_Core_BAO_LocationType',
163 'name' => 'display_name',
164 'type' => CRM_Utils_Type
::T_STRING
,
165 'title' => ts('Display Name'),
166 'description' => ts('Location Type Display Name.'),
168 'size' => CRM_Utils_Type
::BIG
,
169 'where' => 'civicrm_location_type.display_name',
170 'table_name' => 'civicrm_location_type',
171 'entity' => 'LocationType',
172 'bao' => 'CRM_Core_BAO_LocationType',
177 'name' => 'vcard_name',
178 'type' => CRM_Utils_Type
::T_STRING
,
179 'title' => ts('vCard Location Type'),
180 'description' => ts('vCard Location Type Name.'),
182 'size' => CRM_Utils_Type
::BIG
,
183 'where' => 'civicrm_location_type.vcard_name',
184 'table_name' => 'civicrm_location_type',
185 'entity' => 'LocationType',
186 'bao' => 'CRM_Core_BAO_LocationType',
191 'name' => 'description',
192 'type' => CRM_Utils_Type
::T_STRING
,
193 'title' => ts('Description'),
194 'description' => ts('Location Type Description.'),
196 'size' => CRM_Utils_Type
::HUGE
,
197 'where' => 'civicrm_location_type.description',
198 'table_name' => 'civicrm_location_type',
199 'entity' => 'LocationType',
200 'bao' => 'CRM_Core_BAO_LocationType',
203 'label' => ts("Description"),
208 'name' => 'is_reserved',
209 'type' => CRM_Utils_Type
::T_BOOLEAN
,
210 'title' => ts('Location Type is Reserved?'),
211 'description' => ts('Is this location type a predefined system location?'),
212 'where' => 'civicrm_location_type.is_reserved',
213 'table_name' => 'civicrm_location_type',
214 'entity' => 'LocationType',
215 'bao' => 'CRM_Core_BAO_LocationType',
220 'name' => 'is_active',
221 'type' => CRM_Utils_Type
::T_BOOLEAN
,
222 'title' => ts('Location Type is Active?'),
223 'description' => ts('Is this property active?'),
224 'where' => 'civicrm_location_type.is_active',
225 'table_name' => 'civicrm_location_type',
226 'entity' => 'LocationType',
227 'bao' => 'CRM_Core_BAO_LocationType',
232 'name' => 'is_default',
233 'type' => CRM_Utils_Type
::T_BOOLEAN
,
234 'title' => ts('Default Location Type?'),
235 'description' => ts('Is this location type the default?'),
236 'where' => 'civicrm_location_type.is_default',
237 'table_name' => 'civicrm_location_type',
238 'entity' => 'LocationType',
239 'bao' => 'CRM_Core_BAO_LocationType',
244 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
246 return Civi
::$statics[__CLASS__
]['fields'];
250 * Return a mapping from field-name to the corresponding key (as used in fields()).
253 * Array(string $name => string $uniqueName).
255 public static function &fieldKeys() {
256 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
257 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
259 return Civi
::$statics[__CLASS__
]['fieldKeys'];
263 * Returns the names of this table
267 public static function getTableName() {
268 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
272 * Returns if this table needs to be logged
276 public function getLog() {
281 * Returns the list of fields that can be imported
283 * @param bool $prefix
287 public static function &import($prefix = FALSE) {
288 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'location_type', $prefix, []);
293 * Returns the list of fields that can be exported
295 * @param bool $prefix
299 public static function &export($prefix = FALSE) {
300 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'location_type', $prefix, []);
305 * Returns the list of indices
307 * @param bool $localize
311 public static function indices($localize = TRUE) {
318 'localizable' => FALSE,
320 'sig' => 'civicrm_location_type::1::name',
323 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;