Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
IBlockElementFilter.php
1
<?php
2
3
namespace
Bitrix\Lists\Api\Data\IBlockService
;
4
5
use
Bitrix\Lists\Api\Data\Filter
;
6
7
class
IBlockElementFilter
extends
Filter
8
{
9
public
const
ALLOWABLE_FIELDS
= [
10
'ID'
,
11
// ACTIVE - Y
12
// 'NAME',
13
'CHECK_PERMISSIONS'
,
14
// PERMISSIONS_BY
15
'MIN_PERMISSION'
,
16
'CREATED_BY'
,
17
'IBLOCK_ID'
,
18
// SITE_ID,
19
'IBLOCK_TYPE'
,
20
'SECTION_ID'
,
21
// SHOW_HISTORY
22
'SHOW_NEW'
23
];
24
25
public
function
setField
(
string
$fieldId, $value,
string
$operator =
''
): static
26
{
27
if
($fieldId ===
'CHECK_PERMISSIONS'
)
28
{
29
return
$this->
setCheckPermission
(is_bool($value) ? $value : ($value ===
'Y'
));
30
}
31
32
return
parent::setField($fieldId, $value, $operator);
33
}
34
35
public
function
setIBlockType
(
string
$iBlockType): static
36
{
37
if
(!empty($iBlockType))
38
{
39
$this->
setField
(
'IBLOCK_TYPE'
, $iBlockType,
'='
);
40
}
41
42
return
$this;
43
}
44
45
public
function
setCreatedBy
(
int
$userId): static
46
{
47
if
($userId >= 0)
48
{
49
$this->
setField
(
'CREATED_BY'
, (
string
)$userId,
'='
);
50
}
51
52
return
$this;
53
}
54
55
public
function
setCheckPermission
(
bool
$value): static
56
{
57
$this->filter[
'CHECK_PERMISSIONS'
] = $value ?
'Y'
:
'N'
;
58
$this->keyMatching[
'CHECK_PERMISSIONS'
] =
'CHECK_PERMISSIONS'
;
59
60
return
$this;
61
}
62
63
public
function
setId
(
int
$id): static
64
{
65
if
($id >= 0)
66
{
67
$this->
setField
(
'ID'
, $id,
'='
);
68
}
69
70
return
$this;
71
}
72
73
public
function
setIBlockId
(
int
$iBlockId): static
74
{
75
if
($iBlockId > 0)
76
{
77
$this->
setField
(
'IBLOCK_ID'
, $iBlockId,
'='
);
78
}
79
80
return
$this;
81
}
82
83
public
function
setShowNew
(
bool
$flag): static
84
{
85
$this->
setField
(
'SHOW_NEW'
, $flag ?
'Y'
:
'N'
);
86
87
return
$this;
88
}
89
90
public
function
setMinPermission
(
string
$permission): static
91
{
92
if
(in_array($permission, [
'E'
,
'S'
,
'T'
,
'R'
,
'U'
,
'W'
,
'X'
],
true
))
93
{
94
$this->
setField
(
'MIN_PERMISSION'
, $permission);
95
}
96
97
return
$this;
98
}
99
}
Bitrix\Lists\Api\Data\Filter
Definition
Filter.php:6
Bitrix\Lists\Api\Data\IBlockService\IBlockElementFilter
Definition
IBlockElementFilter.php:8
Bitrix\Lists\Api\Data\IBlockService\IBlockElementFilter\setCheckPermission
setCheckPermission(bool $value)
Definition
IBlockElementFilter.php:55
Bitrix\Lists\Api\Data\IBlockService\IBlockElementFilter\setCreatedBy
setCreatedBy(int $userId)
Definition
IBlockElementFilter.php:45
Bitrix\Lists\Api\Data\IBlockService\IBlockElementFilter\setMinPermission
setMinPermission(string $permission)
Definition
IBlockElementFilter.php:90
Bitrix\Lists\Api\Data\IBlockService\IBlockElementFilter\setIBlockType
setIBlockType(string $iBlockType)
Definition
IBlockElementFilter.php:35
Bitrix\Lists\Api\Data\IBlockService\IBlockElementFilter\ALLOWABLE_FIELDS
const ALLOWABLE_FIELDS
Definition
IBlockElementFilter.php:9
Bitrix\Lists\Api\Data\IBlockService\IBlockElementFilter\setShowNew
setShowNew(bool $flag)
Definition
IBlockElementFilter.php:83
Bitrix\Lists\Api\Data\IBlockService\IBlockElementFilter\setField
setField(string $fieldId, $value, string $operator='')
Definition
IBlockElementFilter.php:25
Bitrix\Lists\Api\Data\IBlockService\IBlockElementFilter\setIBlockId
setIBlockId(int $iBlockId)
Definition
IBlockElementFilter.php:73
Bitrix\Lists\Api\Data\IBlockService\IBlockElementFilter\setId
setId(int $id)
Definition
IBlockElementFilter.php:63
Bitrix\Lists\Api\Data\IBlockService
Definition
IBlockElementFilter.php:3
modules
lists
lib
Api
Data
IBlockService
IBlockElementFilter.php
Создано системой
1.10.0