kalmanolah / php-query-filter-bundle
Symfony2 bundle for easing query filtering by arbitrary criteria.
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^5.3.3 || ^7.0
- kalmanolah/php-query-filters: dev-master
This package is not auto-updated.
Last update: 2023-07-08 12:45:21 UTC
README
php-query-filter-bundle is a Symfony2 bundle for php-query-filters.
Installing
Include the bundle in your project with composer:
$ composer require kalmanolah/php-query-filter-bundle
Add the bundle to your app/AppKernel.php
file:
<?php use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; class AppKernel extends Kernel { public function registerBundles() { $bundles = array( ... new KalmanOlah\QueryFilterBundle\KalmanOlahQueryFilterBundle(), ... ); ... } ... }
Usage
This bundle defines one main service: query_filters
. You can use it to
retrieve filter sets. The bundle defines the filter sets mongodb
and
doctrine_orm
out of the box, but you can roll your own.
Getting a filter set:
$filterSet = $container->get('query_filters')->get('mongodb'); // From here on out it's business as usual $filterSet->filter($query, $filters);
License
See LICENSE