![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-advanced-search/Model/Client/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\AdvancedSearch\Model\Client; use Magento\Framework\ObjectManagerInterface; use Magento\AdvancedSearch\Helper\Data; class ClientFactory implements ClientFactoryInterface { /** * Object var * * @var ObjectManagerInterface */ protected $objectManager; /** * @var string */ private $clientClass; /** * @var string */ private $openSearch; /** * @var Data */ protected $helper; /** * @param ObjectManagerInterface $objectManager * @param string $clientClass * @param Data $helper * @param string|null $openSearch */ public function __construct( ObjectManagerInterface $objectManager, $clientClass, Data $helper, $openSearch = null ) { $this->objectManager = $objectManager; $this->clientClass = $clientClass; $this->openSearch = $openSearch; $this->helper = $helper; } /** * Return search client * * @param array $options * @return ClientInterface */ public function create(array $options = []) { $class = $this->clientClass; if ($this->helper->isClientOpenSearchV2()) { $class = $this->openSearch; } return $this->objectManager->create( $class, ['options' => $options] ); } }