PHPackages                             rulerz-php/doctrine-dbal - 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. rulerz-php/doctrine-dbal

ActiveLibrary

rulerz-php/doctrine-dbal
========================

Doctrine DBAL compilation target for RulerZ

53.4k6PHPCI failing

Since Jul 28Pushed 5y ago1 watchersCompare

[ Source](https://github.com/rulerz-php/doctrine-dbal)[ Packagist](https://packagist.org/packages/rulerz-php/doctrine-dbal)[ RSS](/packages/rulerz-php-doctrine-dbal/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Doctrine DBAL compilation target for RulerZ [![Build Status](https://camo.githubusercontent.com/cc73492c870b871efc0b3446be49361df519976b8fbf66182789bd8c0ba6c09e/68747470733a2f2f7472617669732d63692e6f72672f72756c65727a2d7068702f646f637472696e652d6462616c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rulerz-php/doctrine-dbal)
===================================================================================================================================================================================================================================================================================================================================================

[](#doctrine-dbal-compilation-target-for-rulerz-)

Doctrine DBAL compilation target for [RulerZ](https://github.com/K-Phoen/rulerz).

Usage
-----

[](#usage)

[Doctrine DBAL](https://www.doctrine-project.org/projects/dbal.html) is one of the targets supported by RulerZ.

This cookbook will show you how to retrieve records using Doctrine DBAL and RulerZ.

Here is a summary of what you will have to do:

- [configure Doctrine DBAL](#configure-doctrine-dbal);
- [configure RulerZ](#configure-rulerz);
- [filter your target](#filter-your-target).

### Configure Doctrine DBAL

[](#configure-doctrine-dbal)

This subject won't be directly treated here. You can either follow the [official documentation](https://www.doctrine-project.org/projects/doctrine-dbal/en/2.8/index.html) or use a bundle/module/whatever the framework you're using promotes.

### Configure RulerZ

[](#configure-rulerz)

Once Doctrine DBAL is installed and configured we can the RulerZ engine:

```
$rulerz = new RulerZ(
    $compiler, [
        new \RulerZ\DoctrineDBAL\Target\DoctrineDBAL(), // this line is Doctrine DBAL-specific
        // other compilation targets...
    ]
);
```

The only Doctrine DBAL-related configuration is the `DoctrineDBAL` target being added to the list of the known compilation targets.

### Filter your target

[](#filter-your-target)

Now that both the DBAL and RulerZ are ready, you can use them to retrieve data.

The `DoctrineDBAL` instance that we previously injected into the RulerZ engine only knows how to use `Doctrine\DBAL\Query\QueryBuilder` so the first step is to create one and configure it:

```
$connection = DriverManager::getConnection([/** connection parameters */]);
$queryBuilder = $connection->createQueryBuilder();

$queryBuilder
    ->select('pseudo', 'gender', 'points')
    ->from('players');
```

And as usual, we call RulerZ with our target (the `QueryBuilder` object) and our rule. RulerZ will build the right executor for the given target and use it to filter the data, or in our case to retrieve data from a database.

```
$rule  = 'gender = :gender and points > :points';
$parameters = [
    'points' => 30,
    'gender' => 'M',
];

var_dump(
    iterator_to_array($rulerz->filter($queryBuilder, $rule, $parameters))
);
```

That's it!

License
-------

[](#license)

This library is under the [MIT](LICENSE) license.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 88.9% 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://avatars.githubusercontent.com/u/66958?v=4)[Kévin Gomez](/maintainers/K-Phoen)[@K-Phoen](https://github.com/K-Phoen)

---

Top Contributors

[![K-Phoen](https://avatars.githubusercontent.com/u/66958?v=4)](https://github.com/K-Phoen "K-Phoen (16 commits)")[![andrew-demb](https://avatars.githubusercontent.com/u/12499813?v=4)](https://github.com/andrew-demb "andrew-demb (2 commits)")

### Embed Badge

![Health badge](/badges/rulerz-php-doctrine-dbal/health.svg)

```
[![Health](https://phpackages.com/badges/rulerz-php-doctrine-dbal/health.svg)](https://phpackages.com/packages/rulerz-php-doctrine-dbal)
```

PHPackages © 2026

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