kalmanolah/php-query-filter-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Symfony2 bundle for easing query filtering by arbitrary criteria.

dev-master 2016-10-10 18:20 UTC

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