PHPackages                             infinite-networks/specifications - 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. infinite-networks/specifications

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

infinite-networks/specifications
================================

A specifications library for the Doctrine ORM

1.1.0(7y ago)85161MITPHP

Since May 6Pushed 7y ago4 watchersCompare

[ Source](https://github.com/infinite-networks/specifications)[ Packagist](https://packagist.org/packages/infinite-networks/specifications)[ RSS](/packages/infinite-networks-specifications/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (1)Versions (12)Used By (0)

Infinite Specifications Library
===============================

[](#infinite-specifications-library)

This library is a base set of objects following the Specification pattern and based on a blog post about taming Doctrines EntityRepository classes.

[http://www.whitewashing.de/2013/03/04/doctrine\_repositories.html](http://www.whitewashing.de/2013/03/04/doctrine_repositories.html)

How to use this library
=======================

[](#how-to-use-this-library)

This library adds 2 methods to the base EntityRepository class, `match` and `matchOne`, which both accept a specification that will build a query builder. Developers need to implement specifications that meet their domain requirements, and each specification must implement the `Infinite\Specification\ORM\Specification` interface.

An example of what using this library could look like:

```
    use Infinite\Specification\ORM as Spec;

    $repository = $managerRegistry->getRepository('Entity\User');

    // Retrieve any enabled users, ordered by username
    $enabledUsersSpec = new Spec\Sort(array('username' => 'ASC'), new Spec\AndX(array(
        new Spec\Equals('enabled', 1)
    ));
    $enabledUsers = $repository->match($enabledUsersSpec);

    // Count enabled users
    $countEnabledUsersSpec = new Spec\SingleScalar(new Spec\Count(new Spec\Equals('enabled', 1)));
    $enabledUsersCount = $repository->matchOne($countEnabledUsersSpec);
```

Doctrine must be configured to use a different base EntityRepository class, and any EntityRepositories implemented in your application must use the EntityRepository class defined in this library as their base class.

To define a different EntityRepository base class in Symfony2, add the following configuration:

```
doctrine:
    orm:
        default_repository_class: Infinite\Specification\ORM\EntityRepository
```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity70

Established project with proven stability

 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.

###  Release Activity

Cadence

Every ~125 days

Recently: every ~264 days

Total

11

Last Release

2820d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2e3241f7860819bc8f9e96ca358198d16574c82c4887eba07958225a6a519042?d=identicon)[jmcleaninf](/maintainers/jmcleaninf)

---

Top Contributors

[![merk](https://avatars.githubusercontent.com/u/278097?v=4)](https://github.com/merk "merk (22 commits)")

### Embed Badge

![Health badge](/badges/infinite-networks-specifications/health.svg)

```
[![Health](https://phpackages.com/badges/infinite-networks-specifications/health.svg)](https://phpackages.com/packages/infinite-networks-specifications)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[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.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[api-platform/doctrine-orm

Doctrine ORM bridge

294.4M90](/packages/api-platform-doctrine-orm)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k12](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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