PHPackages                             saf/doctrine-orm-searchable-repository - 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. saf/doctrine-orm-searchable-repository

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

saf/doctrine-orm-searchable-repository
======================================

Make your Doctrine's EntityRepository Searchable

0.2.2(7y ago)010.9k↓50%MITPHP

Since Feb 20Pushed 7y ago1 watchersCompare

[ Source](https://github.com/vincenttouzet/doctrine-orm-searchable-repository)[ Packagist](https://packagist.org/packages/saf/doctrine-orm-searchable-repository)[ RSS](/packages/saf-doctrine-orm-searchable-repository/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (7)Used By (0)

doctrine-orm-searchable-repository
==================================

[](#doctrine-orm-searchable-repository)

This library extends the EntityRepository to add search functionality with a lot of filters.

```
$filters = [
    'name'        => ['neq' => 'My name'],
    'author.name' => ['in' => ['Foo', 'Bar']],
    'rating'      => ['gte' => 4],
];

$orders = [
    'author.name' => 'ASC',
    'name'        => 'DESC',
];

$entities = $repository->search($filters, $orders);
```

You can even perform search of a value on multiple columns:

```
$filters = [
    'name' => [
        'field'     => ['firstName', 'lastName],
        'condition' => 'like',
        'value'     => '%Lewis%',
    ],
];

$orders = [
    'author.name' => 'ASC',
    'name'        => 'DESC',
];

$entities = $repository->search($filters, $orders);
```

This will result in the following condition :

```
firstName like '%Lewis%' OR lastName like '%Lewis%'
```

How to use
----------

[](#how-to-use)

Install using composer

```
composer require saf/doctrine-orm-searchable-repository

```

And just make your repository class extends `SAF\SearchableRepository\SearchableRepository`.

```
use SAF\SearchableRepository\SearchableRepository;

class MyRepository extends  SearchableRepository
{
    // ...
}
```

Then you can access the `search` method on your repository.

Filters
-------

[](#filters)

This library use filter types to handle how to apply filter condition and ordering. It comes with a GenericType that is the default one but you can add a new filter type.

```
// add a new type handler to your search with the setType function
// the first parameter correspond to the doctrine type
// the second parameter is the filter type (that must implements \SAF\SearchableRepository\SearchableRepository\Types\TypeInterface interface)
$repository->setType('string', new MyStringFilterType());
```

### GenericType

[](#generictype)

FilterSupported valueBehavioreqmixedFilter elements that match the given valueneqmixedFilter elements that not match the given valueltmixedFilter elements with value less than the given valueltemixedFilter elements with value less than or equals the given valuegtmixedFilter elements with value greater than the given valuegtemixedFilter elements with value greater than or equals the given valuelikestringUse a LIKE statement to filter elementsnot\_likestringUse a NOT LIKE statement to filter elementsnullbooleantrue: filter elements with a null value false : filter elements with a non-null valuenot\_nullbooleantrue: filter elements with a non-null value false: filter elements with a null valueinarrayFilter elements with value in the given arraynot\_inarrayFilter elements with value not in the given array

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Recently: every ~176 days

Total

6

Last Release

2659d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/48631f87063e4694039a23a57c65c000b9be36200a541f0dc3b15e69ac69c8f6?d=identicon)[vincenttouzet](/maintainers/vincenttouzet)

---

Top Contributors

[![vincenttouzet](https://avatars.githubusercontent.com/u/2057992?v=4)](https://github.com/vincenttouzet "vincenttouzet (14 commits)")

---

Tags

databaseorm

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/saf-doctrine-orm-searchable-repository/health.svg)

```
[![Health](https://phpackages.com/badges/saf-doctrine-orm-searchable-repository/health.svg)](https://phpackages.com/packages/saf-doctrine-orm-searchable-repository)
```

###  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)[goodwix/doctrine-json-odm

JSON Object-Document Mapping bundle for Symfony and Doctrine

2226.0k](/packages/goodwix-doctrine-json-odm)[mediagone/doctrine-specifications

Doctrine implementation of repository Specifications pattern

353.8k3](/packages/mediagone-doctrine-specifications)

PHPackages © 2026

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