@api
- Since
- 100.0.2
Definition at line 14 of file AdapterFactory.php.
◆ __construct()
- Parameters
-
\Magento\Framework\ObjectManagerInterface | $objectManager | |
array | $adapters | |
EngineResolverInterface | $engineResolver | |
Definition at line 62 of file AdapterFactory.php.
68 $this->adapterPool = $adapters;
69 $this->engineResolver = $engineResolver;
◆ create()
create |
( |
array |
$data = [] | ) |
|
Create Adapter instance
- Parameters
-
- Returns
- \Magento\Framework\Search\AdapterInterface
Definition at line 78 of file AdapterFactory.php.
80 $currentAdapter = $this->engineResolver->getCurrentSearchEngine();
81 if (!isset($this->adapterPool[$currentAdapter])) {
82 throw new \LogicException(
83 'There is no such adapter: ' . $currentAdapter
86 $adapterClass = $this->adapterPool[$currentAdapter];
87 $adapter = $this->objectManager->create($adapterClass,
$data);
88 if (!(
$adapter instanceof \
Magento\Framework\Search\AdapterInterface)) {
89 throw new \InvalidArgumentException(
90 'Adapter must implement \Magento\Framework\Search\AdapterInterface'
◆ $objectManager
◆ $path
◆ $scope
◆ $scopeConfig
The documentation for this class was generated from the following file: