Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
delete.php
1
<?php
2
3
namespace
Bitrix\Location\Repository\Location\Strategy
;
4
5
use
Bitrix\Location\Entity\Location
;
6
use
Bitrix\Location\Repository\Location\Capability\IDelete
;
7
use
Bitrix\Location\Repository\Location\IRepository
;
8
use
Bitrix\Main\Result
;
9
14
class
Delete
15
extends
Base
16
implements
IDelete
17
{
19
protected
$locationRepositories
= [];
20
22
public
function
setLocationRepositories
(array
$locationRepositories
):
Base
23
{
24
foreach
(
$locationRepositories
as $repository)
25
{
26
if
($repository instanceof
IDelete
)
27
{
28
$this->locationRepositories[] = $repository;
29
}
30
}
31
32
return
$this;
33
}
34
39
public
function
delete
(
Location
$location):
Result
40
{
41
$result =
new
Result
();
42
44
foreach
($this->locationRepositories as $repository)
45
{
46
$res = $repository->delete($location);
47
48
if
(!$res->isSuccess())
49
{
50
$result->addErrors($res->getErrors());
51
}
52
}
53
54
return
$result;
55
}
56
}
Bitrix\Location\Entity\Location
Definition
location.php:20
Bitrix\Location\Repository\Location\Strategy\Base
Definition
base.php:13
Bitrix\Location\Repository\Location\Strategy\Delete
Definition
delete.php:17
Bitrix\Location\Repository\Location\Strategy\Delete\$locationRepositories
$locationRepositories
Definition
delete.php:19
Bitrix\Location\Repository\Location\Strategy\Delete\setLocationRepositories
setLocationRepositories(array $locationRepositories)
Definition
delete.php:22
Bitrix\Main\ORM\Data\Result
Definition
result.php:16
Bitrix\Main\Result
Definition
result.php:14
Bitrix\Location\Repository\Location\Capability\IDelete
Definition
idelete.php:13
Bitrix\Location\Repository\Location\IRepository
Definition
irepository.php:11
Bitrix\Location\Entity\Location
Definition
collection.php:3
Bitrix\Location\Repository\Location\Strategy
Definition
base.php:3
modules
location
lib
repository
location
strategy
delete.php
Создано системой
1.10.0