1. Go to this page and download the library: Download queo/doctrine-filter 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/ */
queo / doctrine-filter example snippets
use Queo\DoctrineFilter\FilterBuilder;
use Queo\DoctrineFilter\FilterInterface;
class MyFilter implements FilterInterface
{
public function buildFilter(FilterBuilder $builder)
{
// ...
}
}
public function buildFilter(FilterBuilder $builder)
{
$builder
->add('category', EqualFilterType::class)
->add('price_max', LessThanEqualFilterType::class)
->orderBy('price', 'DESC);
}
use Doctrine\ORM\EntityRepository;
use Queo\DoctrineFilter\Traits\EntityFilterTrait;
class MyRepository extends EntityRepository
{
use EntityFilterTrait;
}