19declare(strict_types=1);
34 protected ArrayObject
$raw;
43 $this->
raw =
new ArrayObject();
59 if (0 < strlen($serialize)) {
60 $this->
raw[$serialize] = $item;
66 foreach ($items as $item) {
73 if ($this->
raw->offsetExists($identification->serialize())) {
74 $item = $this->
raw->offsetGet($identification->serialize());
76 return $item ?? $this->
getLostItem($identification);
85 if ($this->filtered->offsetExists($identification->serialize())) {
86 $item = $this->filtered->offsetGet($identification->serialize());
89 return $item ?? $this->
getLostItem($identification);
94 $this->
raw->offsetUnset($identification->serialize());
101 return $this->filtered->offsetExists($identification->serialize());
104 public function has(): bool
106 return $this->
raw->count() > 0;
111 if (!isset($this->filtered)) {
112 $this->filtered =
new ArrayObject($this->
raw->getArrayCopy());
114 if ($this->filters !== []) {
115 $filter_copy = isset($this->filtered) ? $this->filtered->getArrayCopy() : $this->
raw->getArrayCopy();
116 foreach ($this->filters as $filter) {
117 $filter_copy = array_filter($filter_copy, $filter);
119 $this->filtered->exchangeArray($filter_copy);
145 $to_walk = (array) $this->filtered->getArrayCopy();
146 array_walk($to_walk,
$c);
147 $this->filtered =
new ArrayObject($to_walk);
152 $this->filters[] =
$c;
getLostItem(IdentificationInterface $identification)
addMultiple(isGlobalScreenItem ... $items)
add(isGlobalScreenItem $item)
getSingleItemFromFilter(IdentificationInterface $identification)
getSingleItemFromRaw(IdentificationInterface $identification)
existsInFilter(IdentificationInterface $identification)
Interface IdentificationInterface.
getProviderIdentification()