PHP 클래스 Elcodi\Store\ProductBundle\Services\StoreCategoryTree

상속: extends Elcodi\Component\Core\Wrapper\Abstracts\AbstractCacheWrapper
파일 보기 프로젝트 열기: elcodi/bamboo 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$locale Elcodi\Component\Language\Entity\Interfaces\LocaleInterface Locale in which the categories are stored

공개 메소드들

메소드 설명
__construct ( Elcodi\Component\Product\Services\CategoryTree $categoryTreeService, boolean $loadOnlyCategoriesWithProducts, string $key, Elcodi\Component\Language\Entity\Interfaces\LocaleInterface $locale ) Construct method
getStoreCategoryTree ( ) : array Get category tree
load ( ) : array Load Category tree from cache.
reload ( ) : array Reload Category tree from cache

보호된 메소드들

메소드 설명
buildCategoryTreeAndSaveIntoCache ( ) : array Build category tree and save it into cache
buildStoreCategoryTree ( ) : Array Build the store category tree (Can change depending on categories enabled and store config).
formatCategoryNode ( array $categoryNode ) : array Formats a category node form a category tree to return it on a store friendly format.
formatCategoryTree ( array &$categoryTree ) : array Formats a category tree to return it on a store friendly format.
getKey ( ) Get current key
isCategoryEnabled ( Elcodi\Component\Product\Entity\Category $category ) : boolean Checks if a category is enabled. A category can be disabled by itself or by other store configurations like the options to only load categories with products.
loadCategoryTreeFromCache ( ) : array Load category tree from cache
saveCategoryTreeIntoCache ( array $categoryTree ) Save given category tree into cache

메소드 상세

__construct() 공개 메소드

Construct method
public __construct ( Elcodi\Component\Product\Services\CategoryTree $categoryTreeService, boolean $loadOnlyCategoriesWithProducts, string $key, Elcodi\Component\Language\Entity\Interfaces\LocaleInterface $locale )
$categoryTreeService Elcodi\Component\Product\Services\CategoryTree The category tree service
$loadOnlyCategoriesWithProducts boolean Load only categories with products
$key string Key where to store info
$locale Elcodi\Component\Language\Entity\Interfaces\LocaleInterface Locale of the categories

buildCategoryTreeAndSaveIntoCache() 보호된 메소드

Build category tree and save it into cache
protected buildCategoryTreeAndSaveIntoCache ( ) : array
리턴 array Category tree

buildStoreCategoryTree() 보호된 메소드

Build the store category tree (Can change depending on categories enabled and store config).
protected buildStoreCategoryTree ( ) : Array
리턴 Array Category tree

formatCategoryNode() 보호된 메소드

A node is supposed to have an entity and a children key.
protected formatCategoryNode ( array $categoryNode ) : array
$categoryNode array The category node to format
리턴 array The formatted category node.

formatCategoryTree() 보호된 메소드

Formats a category tree to return it on a store friendly format.
protected formatCategoryTree ( array &$categoryTree ) : array
$categoryTree array The categories tree.
리턴 array The formatted category tree

getKey() 보호된 메소드

Get current key
protected getKey ( )

getStoreCategoryTree() 공개 메소드

Get category tree
public getStoreCategoryTree ( ) : array
리턴 array Category tree

isCategoryEnabled() 보호된 메소드

Checks if a category is enabled. A category can be disabled by itself or by other store configurations like the options to only load categories with products.
protected isCategoryEnabled ( Elcodi\Component\Product\Entity\Category $category ) : boolean
$category Elcodi\Component\Product\Entity\Category The category to check.
리턴 boolean If the category is enabled and should be showed on the categories tree.

load() 공개 메소드

If element is not loaded yet, loads it from Database and store it into cache.
public load ( ) : array
리턴 array Category tree loaded

loadCategoryTreeFromCache() 보호된 메소드

Load category tree from cache
protected loadCategoryTreeFromCache ( ) : array
리턴 array Category tree

reload() 공개 메소드

Empty cache and load again
public reload ( ) : array
리턴 array Category tree loaded

saveCategoryTreeIntoCache() 보호된 메소드

Save given category tree into cache
protected saveCategoryTreeIntoCache ( array $categoryTree )
$categoryTree array Category tree

프로퍼티 상세

$locale 보호되어 있는 프로퍼티

Locale in which the categories are stored
protected LocaleInterface,Elcodi\Component\Language\Entity\Interfaces $locale
리턴 Elcodi\Component\Language\Entity\Interfaces\LocaleInterface