Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
inlineaction.php
1<?php
2
4
5
11
12final class InlineAction extends Action
13{
17 protected $methodName;
21 private $controllerable;
22
31 public function __construct($name, Controllerable $controllerable, Controller $controller, $config = array())
32 {
33 $this->methodName = $controller->generateActionMethodName($name);
34 $this->controllerable = $controllerable;
35 parent::__construct($name, $controller, $config);
36 }
37
38 protected function buildBinder()
39 {
40 if ($this->binder === null)
41 {
42 $controller = $this->getController();
43 $this->binder = AutoWire\ControllerBinder::buildForMethod($this->controllerable, $this->methodName)
44 ->setController($controller)
45 ->setSourcesParametersToMap($controller->getSourceParametersList())
46 ->setAutoWiredParameters(
47 array_filter(array_merge(
48 [$controller->getPrimaryAutoWiredParameter()],
49 $controller->getAutoWiredParameters()
50 ))
51 )
52 ;
53 }
54
55 return $this;
56 }
57
59 {
60 $result = parent::runWithSourceParametersList();
61
62 if ($this->controllerable instanceof Errorable)
63 {
64 $this->errorCollection->add(
65 $this->controllerable->getErrors()
66 );
67 }
68
69 return $result;
70 }
71}
__construct($name, Controllerable $controllerable, Controller $controller, $config=array())