Property | Type | Description | |
---|---|---|---|
$categoryManager | Sonata\Component\Product\ProductCategoryManagerInterface | ||
$factory | Knp\Menu\FactoryInterface | ||
$router | Symfony\Component\Routing\RouterInterface |
Method | Description | |
---|---|---|
__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. |
Method | Description | |
---|---|---|
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. |
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 |
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 |
public createCategoryMenu ( array $itemOptions = [], string $currentUri = null ) : Knp\Menu\ItemInterface | ||
$itemOptions | array | The options given to the created menuItem |
$currentUri | string | The current URI |
return | Knp\Menu\ItemInterface |
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) |
return | string |
protected getFilterName ( $filter, $option ) : string | ||
$filter | ||
$option | ||
return | string |
protected getFilterUri ( $currentUri, $filter, $option ) : string | ||
$currentUri | ||
$filter | ||
$option | ||
return | string |
protected ProductCategoryManagerInterface,Sonata\Component\Product $categoryManager | ||
return | Sonata\Component\Product\ProductCategoryManagerInterface |
protected FactoryInterface,Knp\Menu $factory | ||
return | Knp\Menu\FactoryInterface |