Elcodi\Store\ProductBundle\Services\StoreCategoryTree::load PHP Метод

load() публичный Метод

If element is not loaded yet, loads it from Database and store it into cache.
public load ( ) : array
Результат array Category tree loaded
    public function load()
    {
        if (is_array($this->storeCategoryTree)) {
            return $this->storeCategoryTree;
        }
        /**
         * Fetch key from cache
         */
        $storeCategoryTree = $this->loadCategoryTreeFromCache();
        /**
         * If cache key is empty, build it
         */
        if (is_null($storeCategoryTree)) {
            $storeCategoryTree = $this->buildCategoryTreeAndSaveIntoCache();
        }
        $this->storeCategoryTree = $storeCategoryTree;
        return $storeCategoryTree;
    }