Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
gridresponse.php
1
<?php
2
3
namespace
Bitrix\Main\Grid\UI
;
4
5
use
Bitrix\Main\Application
;
6
use
Bitrix\Main\Engine\Response\Json
;
7
use CMain;
8
12
class
GridResponse
implements
\Bitrix\Main\Grid\GridResponse
13
{
17
private
array $messages = [];
18
29
public
function
addMessage
(
string
$message,
string
$type): void
30
{
31
$this->messages[] = [
32
'TYPE'
=> $type,
33
'TEXT'
=> $message,
34
];
35
}
36
42
public
function
isSendable
(): bool
43
{
44
return
! empty($this->messages);
45
}
46
52
public
function
send
(): void
53
{
54
global $APPLICATION;
55
60
$APPLICATION->RestartBuffer();
61
62
$response =
new
Json
([
63
'messages'
=> $this->messages,
64
]);
65
66
Application::getInstance
()->end(200, $response);
67
}
68
}
Bitrix\Main\Application
Definition
application.php:28
Bitrix\Main\Application\getInstance
static getInstance()
Definition
application.php:95
Bitrix\Main\Engine\Response\Json
Definition
json.php:11
Bitrix\Main\Grid\UI\GridResponse
Definition
gridresponse.php:13
Bitrix\Main\Grid\UI\GridResponse\addMessage
addMessage(string $message, string $type)
Definition
gridresponse.php:29
Bitrix\Main\Grid\UI\GridResponse\isSendable
isSendable()
Definition
gridresponse.php:42
Bitrix\Main\Grid\GridResponse
Definition
gridresponse.php:13
Bitrix\Main\Grid\GridResponse\send
send()
Definition
gridresponse.php:52
Bitrix\Main\Grid\UI
Definition
gridrequest.php:3
modules
main
lib
grid
ui
gridresponse.php
Создано системой
1.10.0