Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
dbfieldconverter.php
1<?php
2
4
6
13{
20 public static function convertToDbField(Entity\Address $address): array
21 {
22 $locationId = 0;
23
24 if ($location = $address->getLocation())
25 {
26 $locationId = $location->getId();
27 }
28
29 $latitude = $address->getLatitude();
30 $longitude = $address->getLongitude();
31
32 return [
33 'ID' => $address->getId(),
34 'LOCATION_ID' => $locationId,
35 'LANGUAGE_ID' => $address->getLanguageId(),
36 'LATITUDE' => $latitude === '' ? null : (float)$latitude,
37 'LONGITUDE' => $longitude === '' ? null : (float)$longitude,
38 ];
39 }
40}