PHP 클래스 Sonata\ProductBundle\Menu\ProductMenuBuilder

저자: Hugo Briand ([email protected])
파일 보기 프로젝트 열기: sonata-project/ecommerce 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$categoryManager Sonata\Component\Product\ProductCategoryManagerInterface
$factory Knp\Menu\FactoryInterface
$router Symfony\Component\Routing\RouterInterface

공개 메소드들

메소드 설명
__construct ( Knp\Menu\FactoryInterface $factory, Sonata\Component\Product\ProductCategoryManagerInterface $categoryManager, Symfony\Component\Routing\RouterInterface $router ) Constructor.
buildCategoryMenu ( Knp\Menu\ItemInterface $menu, array $options = [], string $currentUri = null )
createCategoryMenu ( array $itemOptions = [], string $currentUri = null ) : Knp\Menu\ItemInterface
createFiltersMenu ( Sonata\Component\Product\ProductProviderInterface $productProvider, array $itemOptions = [], string $currentUri = null ) : mixed Generates the filters menu based on $productProvider.

보호된 메소드들

메소드 설명
fillMenu ( Knp\Menu\ItemInterface $menu, array $categories, array $options = [], string $currentUri = null ) Recursive method to fill $menu with $categories.
getCategoryTitle ( Sonata\ClassificationBundle\Model\CategoryInterface $category, integer $limit = 500 ) : string Gets the HTML associated with the category menu title.
getFilterName ( $filter, $option ) : string Generates the name of the filter based on $filter and $option.
getFilterUri ( $currentUri, $filter, $option ) : string Generates the filter uri.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( Knp\Menu\FactoryInterface $factory, Sonata\Component\Product\ProductCategoryManagerInterface $categoryManager, Symfony\Component\Routing\RouterInterface $router )
$factory Knp\Menu\FactoryInterface
$categoryManager Sonata\Component\Product\ProductCategoryManagerInterface
$router Symfony\Component\Routing\RouterInterface

buildCategoryMenu() 공개 메소드

public buildCategoryMenu ( Knp\Menu\ItemInterface $menu, array $options = [], string $currentUri = null )
$menu Knp\Menu\ItemInterface The item to fill with $routes
$options array The item options
$currentUri string The current URI

createCategoryMenu() 공개 메소드

public createCategoryMenu ( array $itemOptions = [], string $currentUri = null ) : Knp\Menu\ItemInterface
$itemOptions array The options given to the created menuItem
$currentUri string The current URI
리턴 Knp\Menu\ItemInterface

createFiltersMenu() 공개 메소드

Generates the filters menu based on $productProvider.
public createFiltersMenu ( Sonata\Component\Product\ProductProviderInterface $productProvider, array $itemOptions = [], string $currentUri = null ) : mixed
$productProvider Sonata\Component\Product\ProductProviderInterface
$itemOptions array
$currentUri string
리턴 mixed

fillMenu() 보호된 메소드

Recursive method to fill $menu with $categories.
protected fillMenu ( Knp\Menu\ItemInterface $menu, array $categories, array $options = [], string $currentUri = null )
$menu Knp\Menu\ItemInterface
$categories array
$options array
$currentUri string

getCategoryTitle() 보호된 메소드

Gets the HTML associated with the category menu title.
protected getCategoryTitle ( Sonata\ClassificationBundle\Model\CategoryInterface $category, integer $limit = 500 ) : string
$category Sonata\ClassificationBundle\Model\CategoryInterface A category instance
$limit integer A limit for calculation (fixed to 500 by default)
리턴 string

getFilterName() 보호된 메소드

Generates the name of the filter based on $filter and $option.
protected getFilterName ( $filter, $option ) : string
$filter
$option
리턴 string

getFilterUri() 보호된 메소드

Generates the filter uri.
protected getFilterUri ( $currentUri, $filter, $option ) : string
$currentUri
$filter
$option
리턴 string

프로퍼티 상세

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

protected ProductCategoryManagerInterface,Sonata\Component\Product $categoryManager
리턴 Sonata\Component\Product\ProductCategoryManagerInterface

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

protected FactoryInterface,Knp\Menu $factory
리턴 Knp\Menu\FactoryInterface

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

protected RouterInterface,Symfony\Component\Routing $router
리턴 Symfony\Component\Routing\RouterInterface