gns / filter-bundle
Symfony filter bundle
Installs: 1 643
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 3
Type:symfony-bundle
pkg:composer/gns/filter-bundle
Requires
- php: ^7.1.3
- ext-ctype: *
- ext-iconv: *
- doctrine/doctrine-bundle: ^2.0
- doctrine/orm: ^2.5.11
- jms/serializer: ^3.3
- knplabs/knp-paginator-bundle: ^5
- symfony/flex: ^1.3
- symfony/framework-bundle: ~5
- symfony/options-resolver: ~5
Requires (Dev)
- roave/security-advisories: dev-master
- symfony/debug-pack: ^1.0
- symfony/maker-bundle: ^1.12
This package is auto-updated.
Last update: 2025-10-08 21:45:37 UTC
README
Knp pagination wrapper accessing filter & sort paginated collections of entities
Instalation
composer require Gns/data-filter-bundle "1.0"
Configuration
Gns_filter:
    checkers_enabled: # bool (default true) Enables prop availability check for filter & sort.
    default_operator: # string (default like) Defines default operator when absent.
    default_order_direction: # enum (ASC,DESC) (default ASC) Defines default order direction when absent.
Collection filters usage
{
    filter:{
        associationNameA: {
            filedName: 'value'
        },
        associationNameB: {
            filedName: {
                operator: 'eq'
                value: 'value'
            }
        },
        associationNameC: {
            filedName: {
                value: 'value' // If no operator defined then triggers default operator - like
            }
        }, 
        associationNameD: {
            associationNameA: {
                associationNameB:{
                    filedName{
                         value: 'value' // If no operator defined then triggers default operator - like
                    }
                }
            }
        }, 
    },
    cfFilter:[
       0:[ // Disjunction query must be an array on indexed arrays of definitions
            associationNameA: {
                filedName: 'value'
            },
            associationNameB: {
                filedName: {
                    operator: 'eq'
                    value: 'value'
                }
            },
            associationNameC: {
                filedName: {
                    value: 'value' // If no operator defined then triggers default operator - like
                }
            },
            associationNameD: {
                associationNameA: {
                    associationNameB:{
                        filedName:{
                             value: 'value' // If no operator defined then triggers default operator - like
                        }
                    }
                }
            }, 
        ], 1:[...], 2:[...]    
    ],
    order:{
        associationNameA: {
            filedName: 'ASC'
        },
        associationNameB: {
            filedName: 'DESC'
        },
        associationNameC: {
            filedName: 'DESC'
        }, 
        associationNameD: {
            associationNameA: {
                associationNameB:{
                    filedName:'ASC'
                }
            }
        }, 
    },
}
Allowed operators
__________________________________________________________________________
|              |                                                         |   
|    'eq'      |       Equal (=)                                         |
|______________|_________________________________________________________|
|              |                                                         |
|    'neq'     |       Not equal (<>)                                    |
|______________|_________________________________________________________|
|              |                                                         |
|    'lt'      |       Less then (<)                                     |
|______________|_________________________________________________________|
|              |                                                         |
|    'lte'     |       Less than or equal (<=)                           |
|______________|_________________________________________________________|
|              |                                                         |
|    'ltel     |       Less than or equal (<= with time to 23:59:59)     |
|______________|_________________________________________________________|
|              |                                                         |
|    'gt'      |       Greater than (>)                                  |
|______________|_________________________________________________________|
|              |                                                         |
|    'gte'     |       Greater than or equal (>=)                        |
|______________|_________________________________________________________|
|              |                                                         |
|    'gtef     |       Greater than or equal (>= with time to 00:00:00)  |
|______________|_________________________________________________________|
|              |                                                         |
|    'in'      |       In (IN delimiter "|")                             |
|______________|_________________________________________________________|
|              |                                                         |
|    'nin'     |       Not in (NOT IN delimiter "|")                     |
|______________|_________________________________________________________|
|              |                                                         |
|    'like     |       Like (LIKE)                                       |
|______________|_________________________________________________________|
|              |                                                         |
|  'not_like'  |       Not like (NOT LIKE)                               |
|______________|_________________________________________________________|
|              |                                                         |
|    'bwn'     |       Between (BETWEEN)                                 |
|______________|_________________________________________________________|
|              |                                                         |
|  'not_bwn'   |       Not between (NOT BETWEEN)                         |
|______________|_________________________________________________________|
|              |                                                         |
|'hv_count_eq' |       Having count (HAVING COUNT(t.f) = :count)         | 
|______________|_________________________________________________________|
|              |                                                         |
|  'is_null'   |       Is Null (t.f IS NULL)                             | 
|______________|_________________________________________________________|
|              |                                                         |
| 'isnt_null'  |       Is not Null (t.f IS NOT NULL)                     | 
|______________|_________________________________________________________|