PHPackages                             adt/query-object-data-source - 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. adt/query-object-data-source

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

adt/query-object-data-source
============================

Ublaboo Datagrid data source bindings for adt/base-query query objects.

v3.0.1(9mo ago)027.1k↓43.8%11MITPHPPHP &gt;=8.0

Since Feb 14Pushed 7mo ago14 watchersCompare

[ Source](https://github.com/AppsDevTeam/QueryObjectDataSource)[ Packagist](https://packagist.org/packages/adt/query-object-data-source)[ RSS](/packages/adt-query-object-data-source/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (35)Used By (1)

Ublaboo Datagrid data source bindings for Doctrine query objects
================================================================

[](#ublaboo-datagrid-data-source-bindings-for-doctrine-query-objects)

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

[](#installation)

via composer:

```
composer require adt/query-object-data-source
```

and in config.neon:

```
extensions:
	- ADT\QueryObjectDataSource\DI\QueryObjectDataSourceExtension
```

Usage
-----

[](#usage)

Inject or autowire QueryObjectDataSourceFactory:

```
/** @var \ADT\QueryObjectDataSource\IQueryObjectDataSourceFactory @autowire */
protected $queryObjectDataSourceFactory;
```

Create query object and wrap it as data source:

```
$qo = /* create query object */;

$dataSource = $this->queryObjectDataSourceFactory->create($qo, "id")
	->setSortCallback(function($queryObject, \Ublaboo\DataGrid\Utils\Sorting $sorting) {
		$sort = $sorting->getSort();

		if (!empty($sort)) {
			foreach ($sort as $order => $by) {
				$queryObject->order("e.$order", $by);
			}
		}
	})
	->setFilterCallback(function ($queryObject, array $filter) {
		foreach ($filter as $field => $value) {
			switch ($column) {
				case 'dateRange':
					$queryObject->byDateRange(QueryObjectDataSource::parseFilterDateRange($fieldSet));
					break;
				case 'date':
					$queryObject->byDate(QueryObjectDataSource::parseFilterDate($fieldSet));
					break;
				default:
					$queryObject->{'by' . $field}($value);
			}
		}
	})
	->setLimitCallback(function ($offset, $limit, $defaultCallback) use ($query, $itemRepository) {
		// This callback is not necessary, but you can do your stuff with $offset and $limit here.

		$defaultCallback();	// Run the default action
	});

$grid->setDataSource($queryObjectDataSource);
```

You can use per column condition and sortable callbacks as well:

```
$datagrid->addColumnText('email', 'entity.user.email')
	->setSortable()
	->setSortableCallback(function (UserQueryObject $userQuery, $email) {
		$userQuery->orderByEmail($email);
	})
	->setFilterText()
	->setCondition(function (UserQueryObject $userQuery, $email) {
		$userQuery->searchInEmail($email);
	});
```

If you implement \\ADT\\QueryObjectDataSource\\IQueryObject on your QueryObject, those methods will be called when there is no per column callbacks provided. Function `searchIn($column, $value)` will be called on text fields and `equalIn($column, $value)` on other column types.

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance59

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community24

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 65.1% 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 ~96 days

Recently: every ~85 days

Total

33

Last Release

294d ago

Major Versions

v1.6.3 → v2.02022-05-15

v2.7 → v3.02025-06-15

PHP version history (3 changes)v1.5PHP &gt;=7.1

v2.0PHP &gt;=7.4

v3.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5575ff5b286a1982356d8ed7d8fc9f44385b44ef1108f34ac8c71b106d0c69ec?d=identicon)[michallohnisky](/maintainers/michallohnisky)

![](https://www.gravatar.com/avatar/b14b3ccdfe1f00a01596de650930f4dcb5de964af406a2cb7a9dafdf75decc6a?d=identicon)[appsdevteam](/maintainers/appsdevteam)

---

Top Contributors

[![thorewi](https://avatars.githubusercontent.com/u/605858?v=4)](https://github.com/thorewi "thorewi (41 commits)")[![NoxZet](https://avatars.githubusercontent.com/u/23127344?v=4)](https://github.com/NoxZet "NoxZet (6 commits)")[![michallohnisky](https://avatars.githubusercontent.com/u/4747059?v=4)](https://github.com/michallohnisky "michallohnisky (5 commits)")[![masicek](https://avatars.githubusercontent.com/u/1160736?v=4)](https://github.com/masicek "masicek (3 commits)")[![vpalousek](https://avatars.githubusercontent.com/u/108008045?v=4)](https://github.com/vpalousek "vpalousek (3 commits)")[![Walusyak](https://avatars.githubusercontent.com/u/20837611?v=4)](https://github.com/Walusyak "Walusyak (2 commits)")[![tkorcina](https://avatars.githubusercontent.com/u/31270983?v=4)](https://github.com/tkorcina "tkorcina (2 commits)")[![Danoha](https://avatars.githubusercontent.com/u/6437793?v=4)](https://github.com/Danoha "Danoha (1 commits)")

### Embed Badge

![Health badge](/badges/adt-query-object-data-source/health.svg)

```
[![Health](https://phpackages.com/badges/adt-query-object-data-source/health.svg)](https://phpackages.com/packages/adt-query-object-data-source)
```

###  Alternatives

[ublaboo/datagrid

DataGrid for Nette Framework: filtering, sorting, pagination, tree view, table view, translator, etc

2971.9M23](/packages/ublaboo-datagrid)[kdyby/doctrine

Doctrine integration into Nette Framework

1091.0M86](/packages/kdyby-doctrine)[nettrine/orm

Doctrine ORM for Nette Framework

581.9M37](/packages/nettrine-orm)[nettrine/migrations

Doctrine Migrations for Nette Framework

411.7M17](/packages/nettrine-migrations)[nettrine/dbal

Doctrine DBAL for Nette Framework

322.6M19](/packages/nettrine-dbal)[nettrine/annotations

Doctrine Annotations for Nette Framework

193.0M7](/packages/nettrine-annotations)

PHPackages © 2026

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