Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
paginationaction.php
1
<?php
2
3
namespace
Bitrix\Main\Grid\Action
;
4
5
use
Bitrix\Main\Grid\Pagination\PageNavigationStorage
;
6
use
Bitrix\Main\HttpRequest
;
7
use
Bitrix\Main\Result
;
8
use
Bitrix\Main\UI\PageNavigation
;
9
15
final
class
PaginationAction
implements
Action
16
{
17
private
PageNavigation
$pagination;
18
private
?
PageNavigationStorage
$storage;
19
25
public
static
function
getId
(): string
26
{
27
return
'pagination'
;
28
}
29
34
public
function
__construct
(
PageNavigation
$pagination, ?
PageNavigationStorage
$storage)
35
{
36
$this->pagination = $pagination;
37
$this->storage = $storage;
38
}
39
49
public
function
processRequest
(
HttpRequest
$request): ?
Result
50
{
51
if
(\
Bitrix
\Main\Context::getCurrent()->getRequest() !== $request)
52
{
53
trigger_error(
'Pagination working only request from context'
, E_USER_WARNING);
54
}
55
56
$tmp = clone $this->pagination;
57
$tmp->setCurrentPage(1);
58
$tmp->initFromUri();
59
60
if
($this->pagination->getCurrentPage() !== $tmp->getCurrentPage())
61
{
62
$this->pagination->setCurrentPage($tmp->getCurrentPage());
63
64
if
(isset($this->storage))
65
{
66
$this->storage->save($this->pagination);
67
}
68
}
69
70
return
new
Result
();
71
}
72
}
Bitrix\Main\Grid\Action\PaginationAction
Definition
paginationaction.php:16
Bitrix\Main\Grid\Action\PaginationAction\__construct
__construct(PageNavigation $pagination, ?PageNavigationStorage $storage)
Definition
paginationaction.php:34
Bitrix\Main\Grid\Action\PaginationAction\getId
static getId()
Definition
paginationaction.php:25
Bitrix\Main\Grid\Action\PaginationAction\processRequest
processRequest(HttpRequest $request)
Definition
paginationaction.php:49
Bitrix\Main\HttpRequest
Definition
httprequest.php:20
Bitrix\Main\ORM\Data\Result
Definition
result.php:16
Bitrix\Main\Result
Definition
result.php:14
Bitrix\Main\UI\PageNavigation
Definition
pagenavigation.php:27
Bitrix\Main\Grid\Action\Action
Definition
action.php:12
Bitrix\Main\Grid\Pagination\PageNavigationStorage
Definition
pagenavigationstorage.php:16
Bitrix\Main\Grid\Action
Definition
action.php:3
Bitrix
modules
main
lib
grid
action
paginationaction.php
Создано системой
1.10.0