PHPackages                             sergeil/doctrine-array-query-builder-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. sergeil/doctrine-array-query-builder-bundle

ActiveSymfony-bundle

sergeil/doctrine-array-query-builder-bundle
===========================================

Provides an alternative way to build query using standard PHP's array notation

015[1 issues](https://github.com/sergeil/SliDoctrineArrayQueryBuilderBundle/issues)[1 PRs](https://github.com/sergeil/SliDoctrineArrayQueryBuilderBundle/pulls)PHP

Since Jan 3Pushed 9y ago1 watchersCompare

[ Source](https://github.com/sergeil/SliDoctrineArrayQueryBuilderBundle)[ Packagist](https://packagist.org/packages/sergeil/doctrine-array-query-builder-bundle)[ RSS](/packages/sergeil-doctrine-array-query-builder-bundle/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

SliDoctrineArrayQueryBuilderBundle [![Build Status](https://camo.githubusercontent.com/c81ff02cc5bdadb887bf593e6fbacb74f95d1491709fc27e7c1f5062f7587a58/68747470733a2f2f7472617669732d63692e6f72672f7365726765696c2f536c69446f637472696e65417272617951756572794275696c64657242756e646c652e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/sergeil/SliDoctrineArrayQueryBuilderBundle)
==================================================================================================================================================================================================================================================================================================================================================================================================

[](#slidoctrinearrayquerybuilderbundle-)

With this bundle on board you will be able to build complex DQL queries using a simple PHP associative arrays notation, this way simplicity of writing queries goes on a whole new level, analytical applications which must allow to build queries from UI will especially benefit from this bundle (bundle out of the box supports client/server communication protocol used by ExtJs framework, in other words).

Teaser
------

[](#teaser)

Say that we have a classical User and Group entities associated as ManyToMany and that User entity have OneToOne association with Profile entity, this is how a sample query could look like:

```
$query = array(
    'filter' => [
        // if the property is OneToMany relation and IN query is used the MEMBER OF query will be built automatically
        array('property' => 'groups', 'value' => 'in:1,2,3'),
        array('property' => 'username', 'value' => 'like:John%'),
        // this will automatically build proper JOINS under the hood
        array('property' => 'profile.insurance.securityNumber', 'value' => 'isNull')
    ],
    'fetch' => [
        // this will inform array query builder that you want to have associated Profile and then Insurance entities
        // to be fetched as well
        'profile.insurance'
    ],
    'sort' => [
        array('property' => 'id', 'direction' => 'DESC')
    ],
    'page' => 1,
    'limit' => 25
);

/* @var \Sli\DoctrineArrayQueryBuilderBundle\Querying\ArrayQueryBuilder $aqb */
$aqb = $container->get('sli_doctrine_array_query_builder.querying.array_query_builder');

// Only those users will be returned:
// 1. belong to groups with IDS 1, 2 and 3
// 2. whose `username`s contain John
// 3. whose associated Insurance entity's securityNumber is NULL
// Result will be ordered by ID field and paginated
$users = $aqb->buildQuery('MyCompany\MyBundle\Entity\User', $query);
```

For all supported functionality please see a functional test located in `Tests/Functional/Querying/ArrayQueryBuilderTest.php`.

Supported filtering operators:

- eq
- neq
- like
- notLike
- gt
- gte
- lt
- lte
- in
- notIn
- isNull
- isNotNull

Installation
------------

[](#installation)

Add this dependency to your composer.json:

```
"sergeil/doctrine-array-query-builder-bundle": "dev-develop"

```

Update your AppKernel class and add this:

```
new \Sli\DoctrineArrayQueryBuilderBundle\SliDoctrineArrayQueryBuilderBundle(),

```

Licensing
---------

[](#licensing)

This bundle is under the MIT license. See the complete license in the bundle: Resources/meta/LICENSE

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/32010d9d9c2226f0c7119fb1d4006d1847a6dd6db135d2fcacba8578a8a13b90?d=identicon)[sergeil](/maintainers/sergeil)

---

Top Contributors

[![sergeil](https://avatars.githubusercontent.com/u/425579?v=4)](https://github.com/sergeil "sergeil (14 commits)")

### Embed Badge

![Health badge](/badges/sergeil-doctrine-array-query-builder-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/sergeil-doctrine-array-query-builder-bundle/health.svg)](https://phpackages.com/packages/sergeil-doctrine-array-query-builder-bundle)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
