Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
SpaceSearchDataCollection.php
1<?php
2
4
6
7final class SpaceSearchDataCollection implements Arrayable
8{
9
11 private array $items = [];
12
13 public function add(SpaceSearchData $spaceSearchData): void
14 {
15 $this->items[] = $spaceSearchData;
16 }
17
18 public function toArray(): array
19 {
20 return $this->items;
21 }
22
23 public function getSpaceSearchDataBySpacesId(int $spaceId): ?SpaceSearchData
24 {
25 $result = null;
26 foreach ($this->items as $item)
27 {
28 if ($spaceId === $item->getSpaceId())
29 {
30 $result = $item;
31 break;
32 }
33 }
34
35 return $result;
36 }
37}