Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
filterabledictionary.php
1
<?php
2
namespace
Bitrix\Main\Type
;
3
4
class
FilterableDictionary
5
extends
Dictionary
6
{
10
protected
$name
;
11
15
protected
$arRawValues
= array();
16
20
protected
$arFilters
= array();
21
27
public
function
__construct
(array
$values
,
$name
=
null
)
28
{
29
$this->values = $this->arRawValues =
$values
;
30
$this->name =
$name
;
31
}
32
33
public
function
addFilter
(IDictionaryFilter $filter)
34
{
35
$this->values = $filter->filterArray($this->values, $this->name);
36
$this->arFilters[] = $filter;
37
}
38
45
public
function
getRaw
(
$name
)
46
{
47
if
(isset($this->arRawValues[
$name
]) || array_key_exists(
$name
, $this->arRawValues))
48
return
$this->arRawValues[
$name
];
49
50
return
null
;
51
}
52
56
public
function
offsetSet
($offset, $value)
57
{
58
$this->values[$offset] = $this->arRawValues[$offset] = $value;
59
foreach
($this->arFilters as $filter)
60
$this->values[$offset] = $filter->filter($this->values[$offset], $this->name.
"["
.$offset.
"]"
, $this->values);
61
}
62
66
public
function
offsetUnset
($offset): void
67
{
68
unset($this->values[$offset]);
69
unset($this->arRawValues[$offset]);
70
}
71
}
Bitrix\Main\Type\Dictionary
Definition
dictionary.php:6
Bitrix\Main\Type\Dictionary\$values
$values
Definition
dictionary.php:10
Bitrix\Main\Type\FilterableDictionary
Definition
filterabledictionary.php:6
Bitrix\Main\Type\FilterableDictionary\$arFilters
$arFilters
Definition
filterabledictionary.php:20
Bitrix\Main\Type\FilterableDictionary\__construct
__construct(array $values, $name=null)
Definition
filterabledictionary.php:27
Bitrix\Main\Type\FilterableDictionary\addFilter
addFilter(IDictionaryFilter $filter)
Definition
filterabledictionary.php:33
Bitrix\Main\Type\FilterableDictionary\offsetUnset
offsetUnset($offset)
Definition
filterabledictionary.php:66
Bitrix\Main\Type\FilterableDictionary\$arRawValues
$arRawValues
Definition
filterabledictionary.php:15
Bitrix\Main\Type\FilterableDictionary\getRaw
getRaw($name)
Definition
filterabledictionary.php:45
Bitrix\Main\Type\FilterableDictionary\$name
$name
Definition
filterabledictionary.php:10
Bitrix\Main\Type\FilterableDictionary\offsetSet
offsetSet($offset, $value)
Definition
filterabledictionary.php:56
Bitrix\Main\Type
Definition
collection.php:2
modules
main
lib
type
filterabledictionary.php
Создано системой
1.10.0