Nextras\Orm\Relationships\HasMany::getIterator PHP Method

getIterator() public method

public getIterator ( ) : Nextras\Orm\Collection\ICollection | Nextras\Orm\Entity\IEntity[] | Traversable
return Nextras\Orm\Collection\ICollection | Nextras\Orm\Entity\IEntity[] | Traversable
    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);
    }