Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
valuesqueue.php
1
<?php
7
namespace
Bitrix\Iblock\InheritedProperty
;
8
9
class
ValuesQueue
10
{
12
protected
$db_values
= array();
13
15
protected
static
$queues
= array();
16
25
public
static
function
getInstance
($key)
26
{
27
if
(!isset(self::$queues[$key]))
28
self::$queues[$key] =
new
ValuesQueue
();
29
return
self::$queues[$key];
30
}
31
37
public
static
function
deleteAll
()
38
{
39
foreach
(self::$queues as $queue)
40
{
41
$queue->db_values = array();
42
}
43
}
44
53
public
function
get
($iblockId)
54
{
55
$ids = array();
56
foreach
($this->db_values[$iblockId] as $id => $loaded)
57
{
58
if
($loaded ===
false
)
59
$ids[$id] = intval($id);
60
}
61
return
$ids;
62
}
63
73
public
function
set
($iblockId, $values)
74
{
75
foreach
($this->db_values[$iblockId] as $id => $loaded)
76
{
77
if
(isset($values[$id]))
78
$this->db_values[$iblockId][$id] = $values[$id];
79
else
80
$this->db_values[$iblockId][$id] = array();
81
}
82
}
83
92
public
function
addElement
($iblockId, $id)
93
{
94
if
(!isset($this->db_values[$iblockId]))
95
{
96
$this->db_values[$iblockId] = array();
97
}
98
99
if
(!isset($this->db_values[$iblockId][$id]))
100
{
101
$this->db_values[$iblockId][$id] =
false
;
102
}
103
}
104
113
public
function
deleteElement
($iblockId, $id)
114
{
115
unset($this->db_values[$iblockId][$id]);
116
}
117
128
public
function
getElement
($iblockId, $id)
129
{
130
return
$this->db_values[$iblockId][$id];
131
}
132
143
public
function
setElement
($iblockId, $id, $value)
144
{
145
$this->db_values[$iblockId][$id] = $value;
146
}
147
}
Bitrix\Iblock\InheritedProperty\ValuesQueue
Definition
valuesqueue.php:10
Bitrix\Iblock\InheritedProperty\ValuesQueue\addElement
addElement($iblockId, $id)
Definition
valuesqueue.php:92
Bitrix\Iblock\InheritedProperty\ValuesQueue\setElement
setElement($iblockId, $id, $value)
Definition
valuesqueue.php:143
Bitrix\Iblock\InheritedProperty\ValuesQueue\$db_values
$db_values
Definition
valuesqueue.php:12
Bitrix\Iblock\InheritedProperty\ValuesQueue\getElement
getElement($iblockId, $id)
Definition
valuesqueue.php:128
Bitrix\Iblock\InheritedProperty\ValuesQueue\getInstance
static getInstance($key)
Definition
valuesqueue.php:25
Bitrix\Iblock\InheritedProperty\ValuesQueue\deleteElement
deleteElement($iblockId, $id)
Definition
valuesqueue.php:113
Bitrix\Iblock\InheritedProperty\ValuesQueue\deleteAll
static deleteAll()
Definition
valuesqueue.php:37
Bitrix\Iblock\InheritedProperty\ValuesQueue\$queues
static $queues
Definition
valuesqueue.php:15
Bitrix\Iblock\InheritedProperty
Definition
basetemplate.php:7
modules
iblock
lib
inheritedproperty
valuesqueue.php
Создано системой
1.10.0