Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
controllerbinder.php
1
<?php
2
3
namespace
Bitrix\Main\Engine\AutoWire
;
4
5
use
Bitrix\Main\Engine\Controller
;
6
use
Bitrix\Main\Result
;
7
8
final
class
ControllerBinder
extends
Binder
9
{
11
private
$controller;
12
13
public
function
getController
():
Controller
14
{
15
return
$this->controller;
16
}
17
18
public
function
setController
(
Controller
$controller):
ControllerBinder
19
{
20
$this->controller = $controller;
21
22
return
$this;
23
}
24
25
protected
function
constructValue
(\ReflectionParameter $parameter,
Parameter
$autoWireParameter,
Result
$captureResult):
Result
26
{
27
$result =
new
Result
();
28
29
$controller = $this->
getController
();
30
31
$errorsBefore = $controller->getErrors();
32
$constructedValue = $autoWireParameter->
constructValue
($parameter, $captureResult, $controller);
33
$errorsAfter = $controller->getErrors();
34
35
$newErrors = array_diff($errorsAfter, $errorsBefore);
36
37
$result->setData([
38
'value'
=> $constructedValue,
39
]);
40
41
if
($newErrors)
42
{
43
$result->addErrors($newErrors);
44
}
45
46
return
$result;
47
}
48
}
Bitrix\Main\Engine\AutoWire\Binder
Definition
binder.php:8
Bitrix\Main\Engine\AutoWire\ControllerBinder
Definition
controllerbinder.php:9
Bitrix\Main\Engine\AutoWire\ControllerBinder\setController
setController(Controller $controller)
Definition
controllerbinder.php:18
Bitrix\Main\Engine\AutoWire\ControllerBinder\getController
getController()
Definition
controllerbinder.php:13
Bitrix\Main\Engine\AutoWire\ControllerBinder\constructValue
constructValue(\ReflectionParameter $parameter, Parameter $autoWireParameter, Result $captureResult)
Definition
controllerbinder.php:25
Bitrix\Main\Engine\AutoWire\Parameter
Definition
parameter.php:9
Bitrix\Main\Engine\AutoWire\Parameter\constructValue
constructValue(\ReflectionParameter $parameter, Result $captureResult, $newThis=null)
Definition
parameter.php:47
Bitrix\Main\Engine\Controller
Definition
controller.php:32
Bitrix\Main\ORM\Data\Result
Definition
result.php:16
Bitrix\Main\Result
Definition
result.php:14
Bitrix\Main\Engine\AutoWire
Definition
binder.php:3
Bitrix\Sender\Internals\QueryController
Definition
action.php:8
modules
main
lib
engine
autowire
controllerbinder.php
Создано системой
1.10.0