public function getParentRecord()
    {
        //brak parenta
        if (!$this->parentId) {
            return;
        }
        //próba pobrania rodzica z cache
        if (null === $parent = \App\Registry::$cache->load($cacheKey = 'category-' . $this->parentId)) {
            //pobieranie rodzica
            \App\Registry::$cache->save($parent = (new \Cms\Orm\CmsCategoryQuery)
                ->withType()
                ->findPk($this->parentId), $cacheKey, 0);
        }
        //zwrot rodzica
        return $parent;
    }
public function getParentRecord()
    {
        //brak parenta
        if (!$this->parentId) {
            return;
        }
        //próba pobrania rodzica z cache
        if (null === $parent = \App\Registry::$cache->load($cacheKey = 'category-' . $this->parentId)) {
            //pobieranie rodzica
            \App\Registry::$cache->save($parent = (new \Cms\Orm\CmsCategoryQuery)
                ->withType()
                ->findPk($this->parentId), $cacheKey, 0);
        }
        //zwrot rodzica
        return $parent;
    }
public function getParentRecord ( ) { //brak parenta if ( ! $ this -> parentId ) { return ; } //próba pobrania rodzica z cache if ( null === $ parent = \ App \ Registry :: $ cache -> load ( $ cacheKey = 'category-' . $ this -> parentId ) ) { //pobieranie rodzica \ App \ Registry :: $ cache -> save ( $ parent = ( new \ Cms \ Orm \ CmsCategoryQuery ) -> withType ( ) -> findPk ( $ this -> parentId ) , $ cacheKey , 0 ) ; } //zwrot rodzica return $ parent ; }
Pobiera rekord rodzica
@return \Cms\Orm\CmsCategoryRecord
Pobiera rekord rodzica