Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
range.php
1
<?php
2
3
namespace
Bitrix\Main\Filter
;
4
5
use \Bitrix\Main\UI\Filter\NumberType;
6
7
class
Range
8
{
9
public
static
function
prepareFrom
(array &$filter, $name, $value)
10
{
11
if
($value !==
''
)
12
{
13
$typeKey =
"{$name}_numsel"
;
14
$operation =
'>='
;
15
if
(isset($filter[$typeKey]))
16
{
17
if
($filter[$typeKey] ===
NumberType::MORE
)
18
{
19
$operation =
'>'
;
20
}
21
unset($filter[$typeKey]);
22
}
23
$filter[
"$operation{$name}"
] = $value;
24
}
25
unset($filter[
"{$name}_from"
]);
26
}
27
28
public
static
function
prepareTo
(array &$filter, $name, $value)
29
{
30
if
($value !==
''
)
31
{
32
$typeKey =
"{$name}_numsel"
;
33
$operation =
'<='
;
34
if
(isset($filter[$typeKey]))
35
{
36
if
($filter[$typeKey] ===
NumberType::LESS
)
37
{
38
$operation =
'<'
;
39
}
40
unset($filter[$typeKey]);
41
}
42
$filter[
"$operation{$name}"
] = $value;
43
}
44
unset($filter[
"{$name}_to"
]);
45
}
46
}
Bitrix\Main\Filter\Range
Definition
range.php:8
Bitrix\Main\Filter\Range\prepareTo
static prepareTo(array &$filter, $name, $value)
Definition
range.php:28
Bitrix\Main\Filter\Range\prepareFrom
static prepareFrom(array &$filter, $name, $value)
Definition
range.php:9
Bitrix\Main\UI\Filter\NumberType\LESS
const LESS
Definition
numbertype.php:15
Bitrix\Main\UI\Filter\NumberType\MORE
const MORE
Definition
numbertype.php:14
Bitrix\Main\Filter
modules
main
lib
filter
range.php
Создано системой
1.10.0