Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
delete.php
1<?php
2
4
9
14class Delete
15 extends Base
16 implements IDelete
17{
19 protected $locationRepositories = [];
20
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}
setLocationRepositories(array $locationRepositories)
Definition delete.php:22