PHPackages                             warrantgroup/doctrine-query-builder - 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. [Database &amp; ORM](/categories/database)
4. /
5. warrantgroup/doctrine-query-builder

ActiveLibrary[Database &amp; ORM](/categories/database)

warrantgroup/doctrine-query-builder
===================================

An elegant lightweight library to dynamically build doctrine queries from structured data. Perfect for an API to interpret how data should be represented without any additional mapping.

0.1.1(9y ago)010MITPHPPHP &gt;=5.6

Since Mar 20Pushed 8y ago4 watchersCompare

[ Source](https://github.com/warrantgroup/doctrine-query-builder)[ Packagist](https://packagist.org/packages/warrantgroup/doctrine-query-builder)[ RSS](/packages/warrantgroup-doctrine-query-builder/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (3)Used By (0)

doctrine-query-builder
======================

[](#doctrine-query-builder)

An elegant lightweight library to dynamically build doctrine queries from structured data. Perfect for an API to interpret how data should be represented without any additional mapping.

Supports unlimited nested AND/OR groups, most of the common SQL operators, joins, order by, distinct etc

### Requirements:

[](#requirements)

- PHP &gt;= 5.6
- Symfony HTTP Foundation &gt; 3.2
- Doctrine ORM &gt; 2.5

### Installation:

[](#installation)

With [Composer](https://getcomposer.org/):

```
{
    "require": {
        "warrantgroup/doctrine-query-builder": "dev-master"
    }
}
```

### Usage:

[](#usage)

```
use \Warrant\Doctrine\QueryBuilder\QueryBuilder;

$repo = $this->getDoctrine()->getManager()->getRepository('AcmeMainBundle:Person');
$qb = new QueryBuilder();

$results = $qb->build($repo, $data)->getQuery()->getResult();

return new JsonResponse($results);
```

### Example data:

[](#example-data)

```
{
    "alias": "p",
    "select": ["p.id"],
    "where": {
        "$or": {
            "p.city": {
                "$same": "c.city"
            },
            "p.zipCode": {
                "$same": "c.zipCode"
            },
            "p.street": {
                "$same": "c.street"
            },
        },
        "c.city": {
            "$in": [
                "New York",
                "London"
            ]
        },
        "c.employees": { "$equals": 1 },
        "l.code": 49,
        "p.country": "$not_null",
        "p.phone": "$is_null",
        "c.assets": { "$gte": 1000 },
        "c.turnover": { "$lt": 10000 },
        "t.code": {
            "$in": [1, 2, 3]
        },
        "r.title": {
            "$not_in": ":titles"
        }
    },
    "distinct": true,
    "params": {
        "titles": ["CFO", "CMO"]
    },
    "orderBy": {
        "p.name": "asc"
    },
    "join": {
        "p.roles": "r",
        "r.company": "c",
        "c.trades": {
            "alias": "t",
            "type": "left"
        }
    }
}
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.7% 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.

###  Release Activity

Cadence

Every ~54 days

Total

2

Last Release

3286d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f7d2f31e2f1952069bdc05707f3b83c871f311c1c470a63a053b71798a4567f0?d=identicon)[lewisdwilliams](/maintainers/lewisdwilliams)

---

Top Contributors

[![kilhage](https://avatars.githubusercontent.com/u/325786?v=4)](https://github.com/kilhage "kilhage (14 commits)")[![djandyr](https://avatars.githubusercontent.com/u/225548?v=4)](https://github.com/djandyr "djandyr (5 commits)")

### Embed Badge

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

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

###  Alternatives

[hautelook/alice-bundle

Symfony bundle to manage fixtures with Alice and Faker.

19519.4M34](/packages/hautelook-alice-bundle)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1022.4k](/packages/rcsofttech-audit-trail-bundle)[ahmed-bhs/doctrine-doctor

Runtime analysis tool for Doctrine ORM integrated into Symfony Web Profiler. Unlike static linters, it analyzes actual query execution at runtime to detect performance bottlenecks, security vulnerabilities, and best practice violations during development with real execution context and data.

813.1k](/packages/ahmed-bhs-doctrine-doctor)[heymoon/doctrine-psql-enum

Store PHP native enums as PostgeSQL custom enum types

254.9k](/packages/heymoon-doctrine-psql-enum)

PHPackages © 2026

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