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)75161MITPHP

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 4d 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 75% 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

2771d 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

[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58523.9M36](/packages/scienta-doctrine-json-functions)[damienharper/auditor-bundle

Integrate auditor library in your Symfony projects.

4542.8M](/packages/damienharper-auditor-bundle)[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[pixelfederation/doctrine-resettable-em-bundle

Symfony bundle for decorating default entity managers using a resettable decorator.

20113.5k](/packages/pixelfederation-doctrine-resettable-em-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.

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)

PHPackages © 2026

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