1. Go to this page and download the library: Download hyvor/doctrine-filterq 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/ */
->keys(function ($keys) {
// only allow these operators
$keys->add('id', 'p.id')->operators('=,>,<');
// or use an array
$keys->add('slug', 'p.slug')->operators(['=', '!=']);
// exclude specific operators
$keys->add('age', 'p.age')->operators('>', true);
})
use Hyvor\FilterQ\Exceptions\FilterQException;
try {
$qb = FilterQ::expression($filter)
->queryBuilder($qb)
->keys(...)
->addWhere();
} catch (FilterQException $e) {
// $e->getMessage() is safe to display to API consumers
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.