1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
map.php
См. документацию.
1<?php
2
3namespace Bitrix\Calendar\Core\Base;
4
5use Bitrix\Main\ArgumentException;
6
10abstract class Map extends Collection
11{
20 public function add($item, $key = null): self
21 {
22 if ($key === null)
23 {
24 throw new ArgumentException('you must transfer the key');
25 }
26
27 $this->collection[$key] = $item;
28
29 if ($this->generator)
30 {
31 $this->generator->send($item);
32 }
33
34 return $this;
35 }
36
42 public function addItems(array $items): Collection
43 {
44 // $this->collection = array_replace($this->collection, $items);
45
46 $this->collection = $this->collection + $items;
47 return $this;
48 }
49
55 public function getItem($key)
56 {
57 return $this->collection[$key] ?? null;
58 }
59
64 public function has($key): bool
65 {
66 return isset($this->collection[$key]);
67 }
68
75 public function updateItem($item, $key): Map
76 {
77 $this->collection[$key] = $item;
78
79 return $this;
80 }
81
86 public function getItemsByKeys(array $keys): Map
87 {
88 return new static(array_intersect_key($this->collection, array_flip($keys)));
89 }
90}
getItemsByKeys(array $keys)
Определения map.php:86
updateItem($item, $key)
Определения map.php:75
add($item, $key=null)
Определения map.php:20
has($key)
Определения map.php:64
addItems(array $items)
Определения map.php:42
getItem($key)
Определения map.php:55
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if(empty($signedUserToken)) $key
Определения quickway.php:257
$items
Определения template.php:224