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

getCachedCollection() protected method

protected getCachedCollection ( ) : Nextras\Orm\Collection\ICollection
return Nextras\Orm\Collection\ICollection
    protected function getCachedCollection()
    {
        $key = spl_object_hash($this->parent->getPreloadContainer()) . '_' . $this->metadata->name;
        $cache = $this->parent->getRepository()->getMapper()->getCollectionCache();
        if (!isset($cache->{$key})) {
            $cache->{$key} = $this->createCollection();
        }
        $this->collection = $cache->{$key};
        return $cache->{$key};
    }