PHP code example of renttek / magento2-search-criteria-processor
1. Go to this page and download the library: Download renttek/magento2-search-criteria-processor library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
renttek / magento2-search-criteria-processor example snippets
class Bar
{
// ...
/** @var DefaultSearchCriteriaProcessor */
private $searchCriteriaProcessor;
public function getList(SearchCriteriaInterface $searchCriteria)
{
$select = $this->getBaseSelect();
$select = $this->searchCriteriaProcessor->process($select, $searchCriteria);
return $this->fetchResult($select);
}
// ...
}