Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
arearepository.php
1
<?php
2
3
namespace
Bitrix\Location\Repository
;
4
5
use
Bitrix\Location\Entity
;
6
use
Bitrix\Location\Model\AreaTable
;
7
use
Bitrix\Main\ORM
;
8
use Bitrix\Location\Model\EO_Area;
9
10
class
AreaRepository
11
{
16
public
function
findByArguments
(array $args): array
17
{
18
$result = [];
19
20
$areasList = AreaTable::getList($args);
21
while
($area = $areasList->fetchObject())
22
{
23
$result[] = Entity\Area\Converter\OrmConverter::convertFromOrm($area);
24
}
25
26
return
$result;
27
}
28
34
public
function
findByTypeAndCode(
string
$type, ?
string
$code =
null
): ?
Entity
\
Area
35
{
37
$area = AreaTable::getList([
'filter'
=> [
38
'=TYPE'
=> $type,
39
'=CODE'
=> $code,
40
]])->fetchObject();
41
42
return
$area ? Entity\Area\Converter\OrmConverter::convertFromOrm($area) : null;
43
}
44
49
public
function
store
(
Entity
\
Area
$area)
50
{
51
return
Entity\Area\Converter\OrmConverter::convertToOrm($area)->save();
52
}
53
}
Bitrix\Location\Entity\Area
Definition
area.php:14
Bitrix\Location\Model\AreaTable
Definition
areatable.php:10
Bitrix\Location\Repository\AreaRepository
Definition
arearepository.php:11
Bitrix\Location\Repository\AreaRepository\findByArguments
findByArguments(array $args)
Definition
arearepository.php:16
Bitrix\Location\Repository\AreaRepository\store
store(Entity\Area $area)
Definition
arearepository.php:49
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Location\Entity
Definition
address.php:3
Bitrix\Location\Repository
Definition
addressrepository.php:3
Bitrix\Main\ORM
modules
location
lib
repository
arearepository.php
Создано системой
1.10.0