Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CollectionFilter.php
Go to the documentation of this file.
1 <?php
8 
11 
16 {
20  protected $queryFactory;
21 
26  {
27  $this->queryFactory = $queryFactory;
28  }
29 
40  public function afterFilter(
41  \Magento\Catalog\Model\Layer\Search\CollectionFilter $subject,
42  $result,
45  ) {
47  $query = $this->queryFactory->get();
48  if (!$query->isQueryTextShort()) {
49  $collection->addSearchFilter($query->getQueryText());
50  }
51  }
52 }