mirror of
https://github.com/bdnugget/magento2.git
synced 2026-11-07 09:17:35 +00:00
54 lines
1.2 KiB
PHP
54 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Copyright © Magento, Inc. All rights reserved.
|
|
* See COPYING.txt for license details.
|
|
*/
|
|
|
|
namespace Magento\Search\Model;
|
|
|
|
/**
|
|
* @api
|
|
* @since 100.0.2
|
|
*/
|
|
class SearchCollectionFactory
|
|
{
|
|
/**
|
|
* Object Manager instance
|
|
*
|
|
* @var \Magento\Framework\ObjectManagerInterface
|
|
*/
|
|
protected $_objectManager = null;
|
|
|
|
/**
|
|
* Instance name to create
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $_instanceName = null;
|
|
|
|
/**
|
|
* Factory constructor
|
|
*
|
|
* @param \Magento\Framework\ObjectManagerInterface $objectManager
|
|
* @param string $instanceName
|
|
*/
|
|
public function __construct(
|
|
\Magento\Framework\ObjectManagerInterface $objectManager,
|
|
$instanceName = \Magento\Search\Model\SearchCollectionInterface::class
|
|
) {
|
|
$this->_objectManager = $objectManager;
|
|
$this->_instanceName = $instanceName;
|
|
}
|
|
|
|
/**
|
|
* Create class instance with specified parameters
|
|
*
|
|
* @param array $data
|
|
* @return \Magento\Search\Model\SearchCollectionInterface
|
|
*/
|
|
public function create(array $data = [])
|
|
{
|
|
return $this->_objectManager->create($this->_instanceName, $data);
|
|
}
|
|
}
|