objectManager = $objectManager; $configValue = $engineResolver->getCurrentSearchEngine(); if (isset($dataProviders[$configValue])) { $this->dataProvider = $dataProviders[$configValue]; } else { throw new \LogicException("DataProvider not found by config {$configValue}"); } } /** * Create data provider * * @param array $data * @return DataProviderInterface */ public function create(array $data = []) { $dataProvider = $this->objectManager->create($this->dataProvider, $data); if (!$dataProvider instanceof DataProviderInterface) { throw new \LogicException( 'DataProvider not instance of interface ' . DataProviderInterface::class ); } return $dataProvider; } }