forked from algolia/algoliasearch-magento-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTopSearch.php
executable file
·41 lines (33 loc) · 1.02 KB
/
TopSearch.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace Algolia\AlgoliaSearch\Block;
use Algolia\AlgoliaSearch\Helper\ConfigHelper;
use Magento\Framework\Data\CollectionDataSourceInterface;
use Magento\Framework\View\Element\Template;
use Magento\Search\Helper\Data as CatalogSearchHelper;
class TopSearch extends Template implements CollectionDataSourceInterface
{
private $config;
private $catalogSearchHelper;
public function __construct(
Template\Context $context,
ConfigHelper $config,
CatalogSearchHelper $catalogSearchHelper,
array $data = []
) {
$this->config = $config;
$this->catalogSearchHelper = $catalogSearchHelper;
parent::__construct($context, $data);
}
public function isDefaultSelector()
{
return $this->config->isDefaultSelector();
}
public function getResultUrl()
{
return $this->catalogSearchHelper->getResultUrl();
}
public function getQueryParamName()
{
return $this->catalogSearchHelper->getQueryParamName();
}
}