PHPackages                             heyday/silverstripe-querybuilder - 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. heyday/silverstripe-querybuilder

ActiveSilverstripe-module

heyday/silverstripe-querybuilder
================================

Builds complex and composable queries to retrieve ArrayLists in SilverStripe

1.3.3(6y ago)61.5k2MITPHPPHP &gt;=5.4.0CI failing

Since May 9Pushed 6y ago25 watchersCompare

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

READMEChangelog (4)Dependencies (2)Versions (10)Used By (0)

SilverStripe Query Builder
==========================

[](#silverstripe-query-builder)

Provides a way to create queries that are flexible and reusable in SilverStripe. A lot like Search Filters.

Installation (with composer)
----------------------------

[](#installation-with-composer)

Installing from composer is easy,

Create or edit a `composer.json` file in the root of your SilverStripe project, and make sure the following is present.

```
{
    "require": {
        "heyday/silverstripe-querybuilder": "1.2.*"
    }
}
```

After completing this step, navigate in Terminal or similar to the SilverStripe root directory and run `composer install` or `composer update` depending on whether or not you have composer already in use.

Overview
--------

[](#overview)

Query builder is a wrapper around the `SQLQuery` object, providing two ways to modify the `SQLQuery` object:

- `Heyday\QueryBuilder\Interfaces\QueryModifierInterface`
- Closure with function signiture `SQLQuery $query, array $data, QueryBuilderInterface $queryBuilder`

Usage
-----

[](#usage)

### Implementing QueryModifierInterface

[](#implementing-querymodifierinterface)

This is a very general modifier, modifiers you build might be more specific to your model.

```
use Heyday\QueryBuilder\Interfaces\QueryBuilderInterface;
use Heyday\QueryBuilder\Interfaces\QueryModifierInterface;

class LikeModifier extends QueryModifierInterface
{
	protected $column;
	public function __construct($column)
	{
		$this->column = $column;
	}
	public function modify(\SQLQuery $query, array $data, QueryBuilderInterface $queryBuilder)
	{
		if (isset($data['search']) && $data['search']) {
			$query->addWhere("{$this->column} LIKE '%{$data['search']}%'");
		}
	}
}
```

### Using a modifier with QueryBuilder

[](#using-a-modifier-with-querybuilder)

```
use Heyday\QueryBuilder\QueryBuilder;

$qb = new QueryBuilder(
	'SiteTree',
	[new LikeModifier('SiteTree.Title')],
	['search' => $request->getVar('q')]
);

foreach ($qb as $page) {
	// Do something with page
}
```

License
-------

[](#license)

SilverStripe Query Builder is licensed under an [MIT license](http://heyday.mit-license.org/)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~476 days

Total

8

Last Release

2365d ago

Major Versions

0.1.x-dev → 1.3.02016-02-26

### Community

Maintainers

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

---

Top Contributors

[![overlandmike](https://avatars.githubusercontent.com/u/22073251?v=4)](https://github.com/overlandmike "overlandmike (11 commits)")[![camspiers](https://avatars.githubusercontent.com/u/51294?v=4)](https://github.com/camspiers "camspiers (10 commits)")[![glenn-bautista](https://avatars.githubusercontent.com/u/375172?v=4)](https://github.com/glenn-bautista "glenn-bautista (2 commits)")[![bendubuisson](https://avatars.githubusercontent.com/u/3079189?v=4)](https://github.com/bendubuisson "bendubuisson (1 commits)")[![LABCAT](https://avatars.githubusercontent.com/u/9105153?v=4)](https://github.com/LABCAT "LABCAT (1 commits)")

### Embed Badge

![Health badge](/badges/heyday-silverstripe-querybuilder/health.svg)

```
[![Health](https://phpackages.com/badges/heyday-silverstripe-querybuilder/health.svg)](https://phpackages.com/packages/heyday-silverstripe-querybuilder)
```

###  Alternatives

[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k15.7k5](/packages/elgg-elgg)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[johnbillion/user-switching

Instant switching between user accounts in WordPress and WooCommerce.

19768.3k2](/packages/johnbillion-user-switching)[silverstripe-themes/simple

The SilverStripe simple theme (default SilverStripe 3 theme)

411.3M8](/packages/silverstripe-themes-simple)[silverstripe/admin

SilverStripe admin interface

262.6M325](/packages/silverstripe-admin)[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)

PHPackages © 2026

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