1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
Request.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\UI\Helpdesk;
4
5
use Bitrix\Main\Error;
6
use Bitrix\Main\Result;
7
use Bitrix\Main\Web\HttpClient;
8
use Bitrix\Main\Web\Json;
9
use Bitrix\Main\Web\Uri;
10
11
class
Request
12
{
13
private
Url
$url;
14
private
RequestParametersBuilder
$requestParametersBuilder;
15
16
public
function
__construct
(
private
string
$path
,
private
?
array
$additionalParameters =
null
)
17
{
18
$this->url =
new
Url
();
19
$this->requestParametersBuilder =
new
RequestParametersBuilder
();
20
}
21
22
public
function
send
():
Result
23
{
24
$httpClient =
new
HttpClient
();
25
$result
=
new
Result
();
26
$response
= $httpClient->get($this->
getPreparedUrl
());
27
28
try
29
{
30
$result
->setData((
array
)Json::decode(
$response
));
31
}
32
catch
(\Exception $e)
33
{
34
$result
->addError(
new
Error
($e->getMessage()));
35
}
36
37
return
$result
;
38
}
39
40
public
function
getUrl
():
Url
41
{
42
return
$this->url
;
43
}
44
45
public
function
getPreparedUrl
():
Uri
46
{
47
$parameters = $this->
getParameters
();
48
49
if
($this->additionalParameters)
50
{
51
$parameters = $this->additionalParameters + $parameters;
52
}
53
54
return
$this->url->getByPath($this->
path
)->addParams($parameters);
55
}
56
57
public
function
getParameters
():
array
58
{
59
return
$this->requestParametersBuilder->build();
60
}
61
}
$path
$path
Определения
access_edit.php:21
Bitrix\Main\Error
Определения
error.php:15
Bitrix\Main\ORM\Data\Result
Определения
result.php:16
Bitrix\Main\Request
Определения
request.php:10
Bitrix\Main\Web\HttpClient
Определения
httpclient.php:24
Bitrix\Main\Web\Uri
Определения
uri.php:17
Bitrix\UI\Helpdesk\Request\getParameters
getParameters()
Определения
Request.php:57
Bitrix\UI\Helpdesk\Request\send
send()
Определения
Request.php:22
Bitrix\UI\Helpdesk\Request\getPreparedUrl
getPreparedUrl()
Определения
Request.php:45
Bitrix\UI\Helpdesk\Request\__construct
__construct(private string $path, private ?array $additionalParameters=null)
Определения
Request.php:16
Bitrix\UI\Helpdesk\Request\getUrl
getUrl()
Определения
Request.php:40
Bitrix\UI\Helpdesk\RequestParametersBuilder
Определения
RequestParametersBuilder.php:19
Bitrix\UI\Helpdesk\Url
Определения
Url.php:8
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
$response
$response
Определения
result.php:21
path
path
Определения
template_copy.php:201
$url
$url
Определения
iframe.php:7
bitrix
modules
ui
lib
Helpdesk
Request.php
Создано системой
1.14.0