Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
base.php
1<?php
2
3
5
6
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(
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
91 final public function getErrors()
92 {
93 return $this->errorCollection->toArray();
94 }
95
101 final public function getErrorByCode($code)
102 {
103 return $this->errorCollection->getErrorByCode($code);
104 }
105}