forked from magento/magento2
/
Fulltext.php
86 lines (80 loc) · 2.38 KB
/
Fulltext.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
/**
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\CatalogSearch\Model;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\Data\Collection\AbstractDb as DbCollection;
use Magento\Framework\Model\Context;
use Magento\Framework\Model\ResourceModel\AbstractResource;
use Magento\Framework\Registry;
use Magento\Search\Model\QueryFactory;
/**
* Catalog advanced search model
*
* @method \Magento\CatalogSearch\Model\ResourceModel\Fulltext _getResource()
* @method \Magento\CatalogSearch\Model\ResourceModel\Fulltext getResource()
* @method int getProductId()
* @method \Magento\CatalogSearch\Model\Fulltext setProductId(int $value)
* @method int getStoreId()
* @method \Magento\CatalogSearch\Model\Fulltext setStoreId(int $value)
* @method string getDataIndex()
* @method \Magento\CatalogSearch\Model\Fulltext setDataIndex(string $value)
*
* @author Magento Core Team <core@magentocommerce.com>
*/
class Fulltext extends \Magento\Framework\Model\AbstractModel
{
/**
* Catalog search data
*
* @var QueryFactory
*/
protected $queryFactory = null;
/**
* Core store config
*
* @var ScopeConfigInterface
*/
protected $_scopeConfig;
/**
* @param Context $context
* @param Registry $registry
* @param QueryFactory $queryFactory
* @param ScopeConfigInterface $scopeConfig
* @param AbstractResource $resource
* @param DbCollection $resourceCollection
* @param array $data
*/
public function __construct(
Context $context,
Registry $registry,
QueryFactory $queryFactory,
ScopeConfigInterface $scopeConfig,
AbstractResource $resource = null,
DbCollection $resourceCollection = null,
array $data = []
) {
$this->queryFactory = $queryFactory;
$this->_scopeConfig = $scopeConfig;
parent::__construct($context, $registry, $resource, $resourceCollection, $data);
}
/**
* @return void
*/
protected function _construct()
{
$this->_init(\Magento\CatalogSearch\Model\ResourceModel\Fulltext::class);
}
/**
* Reset search results cache
*
* @return $this
*/
public function resetSearchResults()
{
$this->getResource()->resetSearchResults();
return $this;
}
}