1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
numbertype.php
См. документацию.
1
<?
2
3
namespace
Bitrix\Main\UI\Filter;
4
5
10
class
NumberType
11
{
12
const
SINGLE
=
"exact"
;
// =
13
const
RANGE
=
"range"
;
// <= =>
14
const
MORE
=
"more"
;
// >
15
const
LESS
=
"less"
;
// <
16
17
22
public
static
function
getList
()
23
{
24
$reflection = new \ReflectionClass(__CLASS__);
25
return
$reflection->getConstants();
26
}
27
32
public
static
function
getPostfix
()
33
{
34
return
"_numsel"
;
35
}
36
43
public
static
function
getLogicFilter
(
array
$data
,
array
$filterFields
)
44
{
45
$filter
= [];
46
$keys = array_filter(
$data
,
function
(
$key
) {
return
(mb_substr(
$key
, 0 - mb_strlen(self::getPostfix())) == self::getPostfix()); }, ARRAY_FILTER_USE_KEY);
47
foreach
($keys as
$key
=>
$val
)
48
{
49
$id = mb_substr(
$key
, 0, 0 - mb_strlen(self::getPostfix()));
50
switch
(
$val
)
51
{
52
case
self::SINGLE:
53
if
(array_key_exists($id.
"_from"
,
$data
))
54
$filter
[
"="
.$id] =
$data
[$id.
"_from"
];
55
else
if
(array_key_exists($id.
"_to"
,
$data
))
56
$filter
[
"="
.$id] =
$data
[$id.
"_to"
];
57
break
;
58
case
self::RANGE:
59
if
(array_key_exists($id.
"_from"
,
$data
))
60
$filter
[
">="
.$id] =
$data
[$id.
"_from"
];
61
if
(array_key_exists($id.
"_to"
,
$data
))
62
$filter
[
"<="
.$id] =
$data
[$id.
"_to"
];
63
break
;
64
case
self::MORE:
65
if
(array_key_exists($id.
"_from"
,
$data
))
66
$filter
[
">"
.$id] =
$data
[$id.
"_from"
];
67
break
;
68
case
self::LESS:
69
if
(array_key_exists($id.
"_to"
,
$data
))
70
$filter
[
"<"
.$id] =
$data
[$id.
"_to"
];
71
break
;
72
}
73
}
74
return
$filter
;
75
}
76
}
Bitrix\Main\UI\Filter\NumberType
Определения
numbertype.php:11
Bitrix\Main\UI\Filter\NumberType\LESS
const LESS
Определения
numbertype.php:15
Bitrix\Main\UI\Filter\NumberType\MORE
const MORE
Определения
numbertype.php:14
Bitrix\Main\UI\Filter\NumberType\getLogicFilter
static getLogicFilter(array $data, array $filterFields)
Определения
numbertype.php:43
Bitrix\Main\UI\Filter\NumberType\getPostfix
static getPostfix()
Определения
numbertype.php:32
Bitrix\Main\UI\Filter\NumberType\getList
static getList()
Определения
numbertype.php:22
Bitrix\Main\UI\Filter\NumberType\SINGLE
const SINGLE
Определения
numbertype.php:12
Bitrix\Main\UI\Filter\NumberType\RANGE
const RANGE
Определения
numbertype.php:13
$data
$data['IS_AVAILABLE']
Определения
.description.php:13
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$filter
$filter
Определения
iblock_catalog_list.php:54
$filterFields
$filterFields
Определения
iblock_catalog_list.php:55
$key
if(empty($signedUserToken)) $key
Определения
quickway.php:257
$val
$val
Определения
options.php:1793
bitrix
modules
main
lib
ui
filter
numbertype.php
Создано системой
1.14.0