1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
base.php
См. документацию.
1<?php
2
3
4namespace Bitrix\Main\Engine\ActionFilter;
5
6
7use Bitrix\Main\Engine\Action;
8use Bitrix\Main\Engine\Controller;
9use Bitrix\Main\Error;
10use Bitrix\Main\ErrorCollection;
11use Bitrix\Main\Errorable;
12use Bitrix\Main\Event;
13
14abstract class Base implements Errorable
15{
19 protected $action;
20
25 final public static function className()
26 {
27 return get_called_class();
28 }
29
33 public function __construct()
34 {
35 $this->errorCollection = new ErrorCollection;
36 }
37
38 final public function bindAction(Action $action)
39 {
40 $this->action = $action;
41
42 return $this;
43 }
44
48 final public function getAction()
49 {
50 return $this->action;
51 }
52
57 public function listAllowedScopes()
58 {
59 return array(
60 Controller::SCOPE_REST,
61 Controller::SCOPE_AJAX,
62 Controller::SCOPE_CLI,
63 );
64 }
65
66 public function onBeforeAction(Event $event)
67 {
68 }
69
70 public function onAfterAction(Event $event)
71 {
72 }
73
80 protected function addError(Error $error)
81 {
82 $this->errorCollection[] = $error;
83
84 return $this;
85 }
86
93 protected function addErrors(array $errors): static
94 {
95 $this->errorCollection->add($errors);
96
97 return $this;
98 }
99
104 final public function getErrors()
105 {
106 return $this->errorCollection->toArray();
107 }
108
114 final public function getErrorByCode($code)
115 {
116 return $this->errorCollection->getErrorByCode($code);
117 }
118}
addError(Error $error)
Определения base.php:80
bindAction(Action $action)
Определения base.php:38
addErrors(array $errors)
Определения base.php:93
onAfterAction(Event $event)
Определения base.php:70
onBeforeAction(Event $event)
Определения base.php:66
getErrorByCode($code)
Определения base.php:114
static className()
Определения base.php:25
Определения error.php:15
Определения event.php:5
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$errors
Определения iblock_catalog_edit.php:74
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
$event
Определения prolog_after.php:141
$error
Определения subscription_card_product.php:20