Fulltext.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\CatalogSearch\Model;
  7. use Magento\Framework\App\Config\ScopeConfigInterface;
  8. use Magento\Framework\Data\Collection\AbstractDb as DbCollection;
  9. use Magento\Framework\Model\Context;
  10. use Magento\Framework\Model\ResourceModel\AbstractResource;
  11. use Magento\Framework\Registry;
  12. use Magento\Search\Model\QueryFactory;
  13. /**
  14. * Catalog advanced search model
  15. *
  16. * @method int getProductId()
  17. * @method \Magento\CatalogSearch\Model\Fulltext setProductId(int $value)
  18. * @method int getStoreId()
  19. * @method \Magento\CatalogSearch\Model\Fulltext setStoreId(int $value)
  20. * @method string getDataIndex()
  21. * @method \Magento\CatalogSearch\Model\Fulltext setDataIndex(string $value)
  22. *
  23. * @deprecated 101.0.0
  24. * @see \Magento\ElasticSearch
  25. */
  26. class Fulltext extends \Magento\Framework\Model\AbstractModel
  27. {
  28. /**
  29. * Catalog search data
  30. *
  31. * @var QueryFactory
  32. */
  33. protected $queryFactory = null;
  34. /**
  35. * Core store config
  36. *
  37. * @var ScopeConfigInterface
  38. */
  39. protected $_scopeConfig;
  40. /**
  41. * @param Context $context
  42. * @param Registry $registry
  43. * @param QueryFactory $queryFactory
  44. * @param ScopeConfigInterface $scopeConfig
  45. * @param AbstractResource $resource
  46. * @param DbCollection $resourceCollection
  47. * @param array $data
  48. */
  49. public function __construct(
  50. Context $context,
  51. Registry $registry,
  52. QueryFactory $queryFactory,
  53. ScopeConfigInterface $scopeConfig,
  54. AbstractResource $resource = null,
  55. DbCollection $resourceCollection = null,
  56. array $data = []
  57. ) {
  58. $this->queryFactory = $queryFactory;
  59. $this->_scopeConfig = $scopeConfig;
  60. parent::__construct($context, $registry, $resource, $resourceCollection, $data);
  61. }
  62. /**
  63. * @return void
  64. */
  65. protected function _construct()
  66. {
  67. $this->_init(\Magento\CatalogSearch\Model\ResourceModel\Fulltext::class);
  68. }
  69. /**
  70. * Reset search results cache
  71. *
  72. * @return $this
  73. * @deprecated 101.0.0 Not used anymore
  74. * @see \Magento\CatalogSearch\Model\ResourceModel\Fulltext::resetSearchResultsByStore
  75. */
  76. public function resetSearchResults()
  77. {
  78. $this->getResource()->resetSearchResults();
  79. return $this;
  80. }
  81. }