Nextras\Orm\Relationships\HasOne::getCachedCollection PHP Метод

getCachedCollection() защищенный Метод

protected getCachedCollection ( ) : Nextras\Orm\Collection\ICollection
Результат Nextras\Orm\Collection\ICollection
    protected function getCachedCollection()
    {
        if ($this->collection !== null) {
            return $this->collection;
        } elseif ($this->parent->getPreloadContainer()) {
            $key = spl_object_hash($this->parent->getPreloadContainer()) . '_' . $this->metadata->name;
            $cache = $this->parent->getRepository()->getMapper()->getCollectionCache();
            if (!isset($cache->{$key})) {
                $cache->{$key} = $this->createCollection();
            }
            $collection = $cache->{$key};
        } else {
            $collection = $this->createCollection();
        }
        return $this->collection = $collection;
    }