Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
ormconverter.php
1
<?php
2
3
namespace
Bitrix\Location\Entity\Area\Converter
;
4
5
use
Bitrix\Location\Entity\Area
;
6
use
Bitrix\Location\Geometry\Converter\Manager
;
7
use
Bitrix\Location\Model\AreaTable
;
8
use Bitrix\Location\Model\EO_Area;
9
10
final
class
OrmConverter
11
{
16
public
static
function
convertToOrm
(
Area
$area): EO_Area
17
{
18
return
AreaTable::createObject
()
19
->setType($area->
getType
())
20
->setCode($area->
getCode
())
21
->setSort($area->
getCode
())
22
->setGeometry(
23
Manager::makeConverter
(
Manager::FORMAT_GEOJSON
)->write(
24
$area->
getGeometry
()
25
)
26
);
27
}
28
33
public
static
function
convertFromOrm
(EO_Area $area):
Area
34
{
35
return
(
new
Area
())
36
->
setType
($area->getType())
37
->setCode($area->getCode())
38
->setSort($area->getSort())
39
->setGeometry(
40
Manager::makeConverter
(
Manager::FORMAT_GEOJSON
)->read(
41
$area->getGeometry()
42
)
43
);
44
}
45
}
Bitrix\Location\Entity\Area\Converter\OrmConverter
Definition
ormconverter.php:11
Bitrix\Location\Entity\Area\Converter\OrmConverter\convertToOrm
static convertToOrm(Area $area)
Definition
ormconverter.php:16
Bitrix\Location\Entity\Area\Converter\OrmConverter\convertFromOrm
static convertFromOrm(EO_Area $area)
Definition
ormconverter.php:33
Bitrix\Location\Entity\Area
Definition
area.php:14
Bitrix\Location\Entity\Area\getType
getType()
Definition
area.php:30
Bitrix\Location\Entity\Area\getCode
getCode()
Definition
area.php:48
Bitrix\Location\Entity\Area\getGeometry
getGeometry()
Definition
area.php:84
Bitrix\Location\Entity\Area\setType
setType(string $type)
Definition
area.php:39
Bitrix\Location\Geometry\Converter\Manager
Definition
manager.php:9
Bitrix\Location\Geometry\Converter\Manager\FORMAT_GEOJSON
const FORMAT_GEOJSON
Definition
manager.php:10
Bitrix\Location\Geometry\Converter\Manager\makeConverter
static makeConverter(string $format)
Definition
manager.php:38
Bitrix\Location\Model\AreaTable
Definition
areatable.php:10
Bitrix\Main\ORM\Data\DataManager\createObject
static createObject($setDefaultValues=true)
Definition
datamanager.php:245
Bitrix\Location\Entity\Area\Converter
Definition
ormconverter.php:3
modules
location
lib
entity
area
converter
ormconverter.php
Создано системой
1.10.0