Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
IBlockToGet.php
1
<?php
2
3
namespace
Bitrix\Lists\Api\Data\IBlockService
;
4
5
class
IBlockToGet
6
{
7
private
IBlockListFilter
$filter;
8
private
array $order = [
'SORT'
=>
'ASC'
];
9
private
bool
$needCheckPermissions =
true
;
10
11
public
function
__construct
(
12
IBlockListFilter
$filter,
13
array $order =
null
,
14
)
15
{
16
$this->filter = $filter;
17
if
($order)
18
{
19
$this->
setOrder
($order);
20
}
21
}
22
23
public
function
getFilter
():
IBlockListFilter
24
{
25
return
$this->filter;
26
}
27
28
public
function
getOrmFilter
(): array
29
{
30
return
$this->filter->getOrmFilter();
31
}
32
33
public
function
setOrder
(array $order): static
34
{
35
$allowedFields = [
'SORT'
,
'NAME'
];
36
$newOrder = [];
37
38
foreach
($order as $field => $sort)
39
{
40
if
(in_array($field, $allowedFields,
true
))
41
{
42
$newOrder[$field] = $sort;
43
}
44
}
45
46
$this->order = $newOrder;
47
48
return
$this;
49
}
50
51
public
function
getOrder
(): array
52
{
53
return
$this->order;
54
}
55
56
public
function
enableCheckPermissions
(): static
57
{
58
$this->
needCheckPermissions
=
true
;
59
60
return
$this;
61
}
62
63
public
function
disableCheckPermissions
(): static
64
{
65
$this->
needCheckPermissions
=
false
;
66
67
return
$this;
68
}
69
70
public
function
needCheckPermissions
(): bool
71
{
72
return
$this->needCheckPermissions;
73
}
74
}
Bitrix\Lists\Api\Data\IBlockService\IBlockListFilter
Definition
IBlockListFilter.php:8
Bitrix\Lists\Api\Data\IBlockService\IBlockToGet
Definition
IBlockToGet.php:6
Bitrix\Lists\Api\Data\IBlockService\IBlockToGet\enableCheckPermissions
enableCheckPermissions()
Definition
IBlockToGet.php:56
Bitrix\Lists\Api\Data\IBlockService\IBlockToGet\disableCheckPermissions
disableCheckPermissions()
Definition
IBlockToGet.php:63
Bitrix\Lists\Api\Data\IBlockService\IBlockToGet\getFilter
getFilter()
Definition
IBlockToGet.php:23
Bitrix\Lists\Api\Data\IBlockService\IBlockToGet\getOrder
getOrder()
Definition
IBlockToGet.php:51
Bitrix\Lists\Api\Data\IBlockService\IBlockToGet\needCheckPermissions
needCheckPermissions()
Definition
IBlockToGet.php:70
Bitrix\Lists\Api\Data\IBlockService\IBlockToGet\getOrmFilter
getOrmFilter()
Definition
IBlockToGet.php:28
Bitrix\Lists\Api\Data\IBlockService\IBlockToGet\__construct
__construct(IBlockListFilter $filter, array $order=null,)
Definition
IBlockToGet.php:11
Bitrix\Lists\Api\Data\IBlockService\IBlockToGet\setOrder
setOrder(array $order)
Definition
IBlockToGet.php:33
Bitrix\Lists\Api\Data\IBlockService
Definition
IBlockElementFilter.php:3
modules
lists
lib
Api
Data
IBlockService
IBlockToGet.php
Создано системой
1.10.0