/** * Возвращает итератор элементов * * @return CollectionInterface */ public function getIterator() : CollectionInterface { if (!$this->collection) { $this->collection = $this->loader->fetchCollection($this->specification, $this->comparator); $this->count = $this->collection->count(); } return $this->collection; }