1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
dictionary.php
См. документацию.
1<?php
2
3namespace Bitrix\Main\Type;
4
5class Dictionary implements \ArrayAccess, \Iterator, \Countable, \JsonSerializable
6{
10 protected $values = [];
11
17 public function __construct(array $values = null)
18 {
19 if($values !== null)
20 {
21 $this->values = $values;
22 }
23 }
24
31 public function get($name)
32 {
33 // this condition a bit faster
34 // it is possible to omit array_key_exists here, but for uniformity...
35 if (isset($this->values[$name]) || \array_key_exists($name, $this->values))
36 {
37 return $this->values[$name];
38 }
39
40 return null;
41 }
42
43 public function set($name, $value = null)
44 {
45 if (\is_array($name))
46 {
47 $this->values = $name;
48 }
49 else
50 {
51 $this[$name] = $value;
52 }
53 }
54
58 public function getValues()
59 {
60 return $this->values;
61 }
62
66 public function setValues($values)
67 {
68 $this->values = $values;
69 }
70
71 public function clear()
72 {
73 $this->values = [];
74 }
75
81 #[\ReturnTypeWillChange]
82 public function current()
83 {
84 return current($this->values);
85 }
86
92 public function next(): void
93 {
94 next($this->values);
95 }
96
102 #[\ReturnTypeWillChange]
103 public function key()
104 {
105 return key($this->values);
106 }
107
113 public function valid(): bool
114 {
115 return (key($this->values) !== null);
116 }
117
123 public function rewind(): void
124 {
125 reset($this->values);
126 }
127
133 public function offsetExists($offset): bool
134 {
135 return isset($this->values[$offset]) || \array_key_exists($offset, $this->values);
136 }
137
143 #[\ReturnTypeWillChange]
144 public function offsetGet($offset)
145 {
146 if (isset($this->values[$offset]) || \array_key_exists($offset, $this->values))
147 {
148 return $this->values[$offset];
149 }
150
151 return null;
152 }
153
159 #[\ReturnTypeWillChange]
160 public function offsetSet($offset, $value)
161 {
162 if($offset === null)
163 {
164 $this->values[] = $value;
165 }
166 else
167 {
168 $this->values[$offset] = $value;
169 }
170 }
171
177 public function offsetUnset($offset): void
178 {
179 unset($this->values[$offset]);
180 }
181
187 public function count(): int
188 {
189 return \count($this->values);
190 }
191
197 public function toArray()
198 {
199 return $this->values;
200 }
201
206 public function isEmpty()
207 {
208 return empty($this->values);
209 }
210
215 #[\ReturnTypeWillChange]
216 public function jsonSerialize()
217 {
218 return $this->values;
219 }
220
221 public function __unserialize(array $data): void
222 {
223 if (isset($data['values']) && is_array($data['values']))
224 {
225 $this->values = $data['values'];
226 }
227 }
228}
offsetUnset($offset)
Определения dictionary.php:177
offsetExists($offset)
Определения dictionary.php:133
__unserialize(array $data)
Определения dictionary.php:221
setValues($values)
Определения dictionary.php:66
offsetGet($offset)
Определения dictionary.php:144
__construct(array $values=null)
Определения dictionary.php:17
offsetSet($offset, $value)
Определения dictionary.php:160
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$name
Определения menu_edit.php:35