Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
action.php
1
<?php
8
namespace
Bitrix\Sender\Internals\QueryController
;
9
10
use
Bitrix\Main\ArgumentException
;
11
use
Bitrix\Main\HttpRequest
;
12
use
Bitrix\Main\Localization\Loc
;
13
14
15
Loc::loadMessages
(__FILE__);
16
17
class
Action
extends
Base
18
{
20
protected
$name
;
21
23
protected
$contentType
;
24
26
protected
$handler
;
27
29
protected
$requestMethod
=
Listener::REQUEST_METHOD_POST
;
30
36
public
static
function
create
(
$name
)
37
{
38
return
new
static
(
$name
);
39
}
40
46
public
function
__construct
(
$name
,
$handler
=
null
)
47
{
48
$this->name =
$name
;
49
if
(
$handler
)
50
{
51
$this->
setHandler
(
$handler
);
52
}
53
}
54
60
public
function
getName
()
61
{
62
return
$this->name
;
63
}
64
72
public
function
setHandler
(
$handler
)
73
{
74
if
(!is_callable(
$handler
))
75
{
76
throw
new
ArgumentException
(
"Argument 'handler' should be callabe."
);
77
}
78
79
$this->handler =
$handler
;
80
return
$this;
81
}
82
88
public
function
getRequestMethod
()
89
{
90
return
$this->requestMethod
;
91
}
92
98
public
function
setRequestMethodGet
()
99
{
100
$this->requestMethod =
Listener::REQUEST_METHOD_GET
;
101
return
$this;
102
}
103
111
public
function
run
(
HttpRequest
$request,
Response
$response)
112
{
113
if
(!$this->handler)
114
{
115
return
;
116
}
117
118
static::call($this->handler, array($request, $response));
119
}
120
}
Bitrix\Main\ArgumentException
Definition
exception.php:34
Bitrix\Main\HttpRequest
Definition
httprequest.php:20
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Response
Definition
response.php:5
Bitrix\Sender\Internals\QueryController\Action
Definition
action.php:18
Bitrix\Sender\Internals\QueryController\Action\__construct
__construct($name, $handler=null)
Definition
action.php:46
Bitrix\Sender\Internals\QueryController\Action\setRequestMethodGet
setRequestMethodGet()
Definition
action.php:98
Bitrix\Sender\Internals\QueryController\Action\$requestMethod
$requestMethod
Definition
action.php:29
Bitrix\Sender\Internals\QueryController\Action\getName
getName()
Definition
action.php:60
Bitrix\Sender\Internals\QueryController\Action\$handler
$handler
Definition
action.php:26
Bitrix\Sender\Internals\QueryController\Action\$name
$name
Definition
action.php:20
Bitrix\Sender\Internals\QueryController\Action\run
run(HttpRequest $request, Response $response)
Definition
action.php:111
Bitrix\Sender\Internals\QueryController\Action\$contentType
$contentType
Definition
action.php:23
Bitrix\Sender\Internals\QueryController\Action\create
static create($name)
Definition
action.php:36
Bitrix\Sender\Internals\QueryController\Action\setHandler
setHandler($handler)
Definition
action.php:72
Bitrix\Sender\Internals\QueryController\Action\getRequestMethod
getRequestMethod()
Definition
action.php:88
Bitrix\Sender\Internals\QueryController\Base
Definition
base.php:20
Bitrix\Sender\Internals\QueryController\Listener\REQUEST_METHOD_POST
const REQUEST_METHOD_POST
Definition
listener.php:21
Bitrix\Sender\Internals\QueryController\Listener\REQUEST_METHOD_GET
const REQUEST_METHOD_GET
Definition
listener.php:22
Bitrix\Sender\Internals\QueryController
Definition
action.php:8
modules
sender
lib
internals
querycontroller
action.php
Создано системой
1.10.0