Smile\ElasticsuiteCatalog\Model\Autocomplete\Category\ItemFactory::create PHP Method

create() public method

{@inheritDoc}
public create ( array $data )
$data array
    public function create(array $data)
    {
        $data = $this->addCategoryData($data);
        unset($data['category']);
        return parent::create($data);
    }

Usage Example

Example #1
0
 /**
  * {@inheritDoc}
  */
 public function getItems()
 {
     $result = [];
     $categoryCollection = $this->getCategoryCollection();
     if ($categoryCollection) {
         foreach ($categoryCollection as $category) {
             $result[] = $this->itemFactory->create(['category' => $category, 'type' => $this->getType()]);
         }
     }
     return $result;
 }