PHPackages                             pkly/query-helper - 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. pkly/query-helper

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

pkly/query-helper
=================

Simple utility class for easier use of Doctrine ORM Queries in certain scenarios

1.1.0(2mo ago)0124↓50%[1 PRs](https://github.com/pkly/query-helper/pulls)MITPHPPHP ^8.4

Since Dec 16Pushed 3mo agoCompare

[ Source](https://github.com/pkly/query-helper)[ Packagist](https://packagist.org/packages/pkly/query-helper)[ RSS](/packages/pkly-query-helper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (12)Versions (5)Used By (0)

QueryHelper
===========

[](#queryhelper)

Simple utility class for easier use of Doctrine ORM Queries in certain scenarios

[![Packagist Downloads](https://camo.githubusercontent.com/5181385a4b88b4893ccf86ce9a5d6ce5a59d2c26cb03870bd1cc5137f9bb734f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706b6c792f71756572792d68656c706572)](https://packagist.org/packages/pkly/query-helper)

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

[](#installation)

Simply run

```
composer require pkly/query-helper

```

Usage
-----

[](#usage)

In your repositories simply return an instance of QueryHelper instead of a full type.

```
class FooEntityRepository extends \Doctrine\ORM\EntityRepository
{
    /**
    * @return QueryHelper
    */
    public function findByOrder(
        Order $order
    ): QueryHelper {
        return new QueryHelper(
            $this->createQueryBuilder('entity')
                ->where('entity.relatedOrder = :relaterOrder')
                ->setParameter('relaterOrder', $order)
        );
    }
}
```

Then use it as normal.

```
// inside of a service, controller, etc.
$helper = $repository->findByOrder($order);

$helper->ids(); // list of ids
$helper->id(); // single id
$helper->value(); // single object
$helper->list(); // list of objects
$helper->reference(); // single reference from Doctrine
$helper->references(); // list of references
$helper->fields(['order']); // single array of fields (one row)
$helper->fieldList(['order']); // list of fields (multiple rows)
$helper->count(); // simple count
$helper->exists(); // boolean existence check

// more advanced use
// load one object with lock from query
$object = $em->getRepository(FooEntity::class)
    ->findByOrder($order)
    ->lockMode(LockMode::PESSIMISTIC_WRITE)
    ->value(); // returns T|null
```

### Feature requests?

[](#feature-requests)

Sure, hit me up with an issue if you wish.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance82

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

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

Total

4

Last Release

61d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0642c17604cd51622ad504c999eb75ba78e5768bfa998eaa2922366fc90f0302?d=identicon)[pkly](/maintainers/pkly)

---

Top Contributors

[![pkly](https://avatars.githubusercontent.com/u/17160364?v=4)](https://github.com/pkly "pkly (8 commits)")

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/pkly-query-helper/health.svg)

```
[![Health](https://phpackages.com/badges/pkly-query-helper/health.svg)](https://phpackages.com/packages/pkly-query-helper)
```

###  Alternatives

[scienta/doctrine-json-functions

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

58723.9M36](/packages/scienta-doctrine-json-functions)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[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)[bartlett/php-compatinfo-db

Reference Database of all functions, constants, classes, interfaces on PHP standard distribution and about 110 extensions

1183.0k1](/packages/bartlett-php-compatinfo-db)[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)
