27 return new self($collection);
36 if (!$this->checkCollection($collection))
38 throw new LogicException(
'The collection contains elements of the wrong class. You need to pass a collection of objects Bitrix\\Calendar\\ICal\\Parser\\Attendee');
40 $this->collection = $collection;
49 $this->collection[] = $attach;
59 return $this->collection;
67 return new ArrayIterator($this->collection);
72 return count($this->collection);
78 private function checkCollection(array $collection): bool
80 if (is_null($collection))
85 $attach = array_filter($collection,
function ($attach) {
86 return !($attach instanceof
Attach);
89 return empty($attach);