PHP Class Smile\ElasticsuiteCatalog\Model\Autocomplete\Category\ItemFactory

Author: Romain Ruaud ([email protected])
Inheritance: extends Magento\Search\Model\Autocomplete\ItemFactory
Show file Open project: smile-sa/elasticsuite Class Usage Examples

Protected Properties

Property Type Description
$categoryNames An array containing category names, to use as local cache

Public Methods

Method Description
__construct ( Magento\Framework\ObjectManagerInterface $objectManager, Magento\Framework\UrlInterface $urlBuilder, Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, Magento\Catalog\Model\ResourceModel\Category $categoryResource ) ItemFactory constructor.
create ( array $data ) {@inheritDoc}

Private Methods

Method Description
addCategoryData ( array $data ) : array Load category data and append them to the original data.
getCategoryBreadcrumb ( Magento\Catalog\Model\Category $category ) : array Return a mini-breadcrumb for a category
getCategoryNameById ( integer $categoryId, integer $storeId ) : string Retrieve a category name by it's id, and store it in local cache
getCategoryUrl ( Magento\Catalog\Model\Category $category ) : string Retrieve category Url from the document source.

Method Details

__construct() public method

ItemFactory constructor.
public __construct ( Magento\Framework\ObjectManagerInterface $objectManager, Magento\Framework\UrlInterface $urlBuilder, Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, Magento\Catalog\Model\ResourceModel\Category $categoryResource )
$objectManager Magento\Framework\ObjectManagerInterface The Object Manager
$urlBuilder Magento\Framework\UrlInterface The Url Builder
$scopeConfig Magento\Framework\App\Config\ScopeConfigInterface The Scope Config
$categoryResource Magento\Catalog\Model\ResourceModel\Category Category Resource Model

create() public method

{@inheritDoc}
public create ( array $data )
$data array

Property Details

$categoryNames protected property

An array containing category names, to use as local cache
protected $categoryNames