Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
routingconfigurator.php
1
<?php
9
namespace
Bitrix\Main\Routing
;
10
11
use
Bitrix\Main\SystemException
;
12
35
class
RoutingConfigurator
36
{
38
protected
$router
;
39
41
protected
$scopeOptions
;
42
46
public
function
__construct
()
47
{
48
$this->scopeOptions =
new
Options
;
49
}
50
51
public
function
__call
($method, $arguments)
52
{
53
// setting option
54
if
(in_array($method,
Options::$optionList
,
true
))
55
{
56
$configuration = $this->
createConfiguration
();
57
return
$configuration->$method(...$arguments);
58
}
59
60
// setting route
61
if
(in_array($method,
RoutingConfiguration::$configurationList
,
true
))
62
{
63
$configuration = $this->
createConfiguration
();
64
return
$configuration->$method(...$arguments);
65
}
66
67
throw
new
SystemException
(sprintf(
68
'Unknown method `%s` for object `%s`'
, $method, get_called_class()
69
));
70
}
71
72
public
function
createConfiguration
()
73
{
74
$configuration =
new
RoutingConfiguration
;
75
76
$configuration->
setConfigurator
($this);
77
$this->router->registerConfiguration($configuration);
78
79
$configuration->setOptions(clone $this->scopeOptions);
80
81
return
$configuration;
82
}
83
84
public
function
mergeOptionsWith
($anotherOptions)
85
{
86
$this->scopeOptions->mergeWith($anotherOptions);
87
}
88
92
public
function
getRouter
()
93
{
94
return
$this->router
;
95
}
96
100
public
function
setRouter
(
$router
)
101
{
102
$this->router =
$router
;
103
}
104
105
public
function
__clone
()
106
{
107
$this->scopeOptions = clone
$this->scopeOptions
;
108
$this->scopeOptions->clearCurrent();
109
}
110
}
Bitrix\Main\Routing\Options
Definition
options.php:16
Bitrix\Main\Routing\Options\$optionList
static $optionList
Definition
options.php:18
Bitrix\Main\Routing\RoutingConfiguration
Definition
routingconfiguration.php:25
Bitrix\Main\Routing\RoutingConfiguration\$configurationList
static $configurationList
Definition
routingconfiguration.php:35
Bitrix\Main\Routing\RoutingConfiguration\setConfigurator
setConfigurator($configurator)
Definition
routingconfiguration.php:56
Bitrix\Main\Routing\RoutingConfigurator
Definition
routingconfigurator.php:36
Bitrix\Main\Routing\RoutingConfigurator\__construct
__construct()
Definition
routingconfigurator.php:46
Bitrix\Main\Routing\RoutingConfigurator\setRouter
setRouter($router)
Definition
routingconfigurator.php:100
Bitrix\Main\Routing\RoutingConfigurator\getRouter
getRouter()
Definition
routingconfigurator.php:92
Bitrix\Main\Routing\RoutingConfigurator\createConfiguration
createConfiguration()
Definition
routingconfigurator.php:72
Bitrix\Main\Routing\RoutingConfigurator\$scopeOptions
$scopeOptions
Definition
routingconfigurator.php:41
Bitrix\Main\Routing\RoutingConfigurator\__call
__call($method, $arguments)
Definition
routingconfigurator.php:51
Bitrix\Main\Routing\RoutingConfigurator\__clone
__clone()
Definition
routingconfigurator.php:105
Bitrix\Main\Routing\RoutingConfigurator\$router
$router
Definition
routingconfigurator.php:38
Bitrix\Main\Routing\RoutingConfigurator\mergeOptionsWith
mergeOptionsWith($anotherOptions)
Definition
routingconfigurator.php:84
Bitrix\Main\SystemException
Definition
exception.php:8
Bitrix\Main\Routing
Definition
_config.php:3
modules
main
lib
routing
routingconfigurator.php
Создано системой
1.10.0