public function getIterator() { /** @var ICollection $collection */ $collection = $this->collection === null && !$this->toAdd && !$this->toRemove && !$this->added && !$this->removed && $this->parent->isPersisted() && $this->parent->getPreloadContainer() ? $this->getCachedCollection() : $this->getCollection(); return $collection->getEntityIterator($this->parent); }