PHPackages                             api-skeletons/zf-doctrine-repository-query-provider - 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. api-skeletons/zf-doctrine-repository-query-provider

ActiveLibrary

api-skeletons/zf-doctrine-repository-query-provider
===================================================

QueryProviders in Doctrine Repositories

1.0.1(8y ago)1371[1 issues](https://github.com/API-Skeletons/zf-doctrine-repository-query-provider/issues)MITPHP

Since Jul 10Pushed 8y ago2 watchersCompare

[ Source](https://github.com/API-Skeletons/zf-doctrine-repository-query-provider)[ Packagist](https://packagist.org/packages/api-skeletons/zf-doctrine-repository-query-provider)[ RSS](/packages/api-skeletons-zf-doctrine-repository-query-provider/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (13)Versions (3)Used By (0)

zf-doctrine-repository-query-provider
=====================================

[](#zf-doctrine-repository-query-provider)

[![Build Status](https://camo.githubusercontent.com/4cb4b6e919bc5b17a44c706c07a034aad066aceb6783e2107a90088abb1e1110/68747470733a2f2f7472617669732d63692e6f72672f4150492d536b656c65746f6e732f7a662d646f637472696e652d7265706f7369746f72792d71756572792d70726f76696465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/API-Skeletons/zf-doctrine-repository-query-provider)[![Total Downloads](https://camo.githubusercontent.com/2463e9a49dc91fb6554e0d9dd45166eb827c4f2944611542f54ead89a04e7d48/68747470733a2f2f706f7365722e707567782e6f72672f6170692d736b656c65746f6e732f7a662d646f637472696e652d7265706f7369746f72792d71756572792d70726f76696465722f646f776e6c6f616473)](https://packagist.org/packages/api-skeletons/zf-doctrine-repository-query-provider)

A plugin for [zf-doctrine-repository](https://github.com/api-skeletons/zf-doctrine-repository)to integrate [Doctrine in Apigility](https://github.com/zfcampus/zf-apigility-doctrine)Query Providers.

This allows you to fetch entities using the same business logic and filtering your Query Providers use. Useful for an RPC where an entity may be required and must have access to the current user. Can be used throughout the application to apply business rules for entity access to the current user.

The intention of this module is to solve the problem of repeated code to validate if a user has access to a given entity.

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

[](#installation)

Installation of this module uses composer. For composer documentation, please refer to [getcomposer.org](http://getcomposer.org/).

```
composer require api-skeletons/zf-doctrine-repository-query-provider
```

Once installed, add `ZF\Doctrine\Repository\Query\Provider` to your list of modules inside `config/application.config.php` or `config/modules.config.php`.

> ### zf-component-installer
>
> [](#zf-component-installer)
>
> If you use [zf-component-installer](https://github.com/zendframework/zf-component-installer), that plugin will install zf-doctrine-repository-query-provider as a module for you.

Configuration
-------------

[](#configuration)

This repository plugin provides access to `find`, `findOneBy`, `findBy`, and `findAll` using the query providers already a part of your application.

To add entities with query providers you should copy file `config/zf-doctrine-repository-query-provider.global.php.dist`to your autoload directory and rename to `config/zf-doctrine-repository-query-provider.global.php` and add each entity you wish to use with this plugin to that configuration.

Use
---

[](#use)

These functions mirror the default functions `find`, `findOneBy`, `findBy`, and `findAll`.

Return an entity by id or null

```
$objectManager
    ->getRepository('Database\Entity\Project')
    ->plugin('queryProvider')
    ->find($id)
    ;
```

Return one entity based on filters

```
$objectManager
    ->getRepository('Database\Entity\Project')
    ->plugin('queryProvider')
    ->findOneBy([
        'name' => $name
    );
```

Return an array of entities based on filters

```
$objectManager
    ->getRepository('Database\Entity\Project')
    ->plugin('queryProvider')
    ->findBy([
        'name' => $name
    );
```

Return all entities the Query Provider provides

```
$objectManager
    ->getRepository('Database\Entity\Project')
    ->plugin('queryProvider')
    ->findAll()
    ;
```

The findBy\* functions also take arguments for sorting, limit, and offset.

###  Health Score

23

↓

LowBetter than 27% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity64

Established project with proven stability

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 ~0 days

Total

2

Last Release

3230d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/49dd7d9dba889ac674b0da447d9c1e69d1128dc3ccbaef98ba83d6ee519fc2d6?d=identicon)[tom\_anderson](/maintainers/tom_anderson)

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/api-skeletons-zf-doctrine-repository-query-provider/health.svg)

```
[![Health](https://phpackages.com/badges/api-skeletons-zf-doctrine-repository-query-provider/health.svg)](https://phpackages.com/packages/api-skeletons-zf-doctrine-repository-query-provider)
```

###  Alternatives

[zf-commons/zfc-user-doctrine-orm

Doctrine2 ORM storage adapter for ZfcUser.

85676.8k18](/packages/zf-commons-zfc-user-doctrine-orm)[hounddog/doctrine-data-fixture-module

Zend Framework 2 Module that provides Doctrine Data-Fixture functionality

37335.4k9](/packages/hounddog-doctrine-data-fixture-module)

PHPackages © 2026

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