Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
entity.php
1<?php
2
4
7
9{
10 protected function processBeforeAction(Main\Engine\Action $action)
11 {
12 if (!Catalog\v2\AgentContract\AccessController::check())
13 {
14 $this->addError(
15 new Main\Error(
16 Main\Localization\Loc::getMessage('CATALOG_CONTROLLER_AGENT_CONTRACT_ENTITY_PERMISSION_DENIED')
17 )
18 );
19 return false;
20 }
21
22 return parent::processBeforeAction($action);
23 }
24
31 public function deleteAction(int $id): void
32 {
33 $deleteResult = Catalog\v2\AgentContract\Manager::delete($id);
34 if (!$deleteResult->isSuccess())
35 {
36 $this->addErrors($deleteResult->getErrors());
37 }
38 }
39
46 public function deleteListAction(array $ids): void
47 {
48 foreach ($ids as $id)
49 {
50 $deleteResult = Catalog\v2\AgentContract\Manager::delete($id);
51 if (!$deleteResult->isSuccess())
52 {
53 $this->addErrors($deleteResult->getErrors());
54 }
55 }
56 }
57}
processBeforeAction(Main\Engine\Action $action)
Definition entity.php:10
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29