PHPackages                             nmarniesse/pomm-filter - 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. nmarniesse/pomm-filter

ActiveLibrary

nmarniesse/pomm-filter
======================

Simple filter implementation for pomm project

v1.1.1(7y ago)32.2k1MITPHPPHP &gt;=5.4.4

Since Nov 2Pushed 7y ago1 watchersCompare

[ Source](https://github.com/nmarniesse/pomm-filter)[ Packagist](https://packagist.org/packages/nmarniesse/pomm-filter)[ RSS](/packages/nmarniesse-pomm-filter/feed)WikiDiscussions master Synced 3d ago

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

Simple filter implementation for [Pomm Project](http://www.pomm-project.org/)
=============================================================================

[](#simple-filter-implementation-for-pomm-project)

Asking a collection of resources is often given with filter needs. But it's not always obvious to handle filters and build the query accordingly: multiple filters on different tables, multiple values for a filter, null values, dates, ...

This library provides a simple implementation to build query's condition from an array of filters.

Requirements and installation
-----------------------------

[](#requirements-and-installation)

- php &gt;=5.4

```
composer require nmarniesse/pomm-filter
```

Usage
-----

[](#usage)

The library helps to create an instance of `PommProject\Foundation\Where` that you could use in every pomm query (see [here](https://github.com/pomm-project/Foundation/blob/master/documentation/foundation.rst#where-the-condition-builder)for further explanation).

To explain what we can do with this library, we can take a practical case: we want to filter on active products with color 'blue' or 'yellow', in category 'accessory', with price between 50 and 100, and which have one tag.

The filter array representation is:

```
use NMarniesse\PommFilter\FilterInterface;

$array_filters = [
    'is_active'  => '1',
    'color'      => ['blue', 'yellow'],
    'category'   => ['accessory'],
    'price_from' => 50,
    'price_to'   => 100,
    'tag'        => FilterInterface::_not_null_,
];
```

With an HTTP query similar to `?filter[is_active]=1&filter[color][]=blue&filter[color][]=yellow&filter[category]=accessory&filter[price_from]=50&filter[price_from]=50&filter[price_to]=100&filter[tag]=_not_null_`you can have he same array in php with `$array_filters = $_GET['filter'];`.

You have your array filters, now let build the query:

```
use NMarniesse\PommFilter\FilterCondition;
use NMarniesse\PommFilter\FilterType\BasicFilter;
use NMarniesse\PommFilter\FilterType\BooleanFilter;

# The sql query with a placeholder for the where condition
$sql = addFilter(new BasicFilter('color', 'p')); // optional
$filter_condition->addFilter(new BooleanFilter('is_active'));
$filter_condition->addFilter(new BasicFilter('category_id', 'c'));
$filter_condition->addFilter(new BasicFilter('unit_price', 'pr', '>='));
$filter_condition->addFilter(new BasicFilter('unit_price', 'pr', '=');

# If you want to filter on prices greater than specific value
$filter4 = new BasicFilter('unit_price', 'p', '=');
$filter2 = new DateTimeFilter('created_at', '', 'addFilter($filter1);
$filter_condition->addFilter($filter2);

# Filter entities which have a score 10 and be active in 2010 january
$filter_condition>getWhere([
    'score_range' => 10,
    'lifetime'    => new RangeValue(
        new \DateTime('2010-01-01 00:00:00+00:00'),
        new \DateTime('2010-12-31 23:59:59+00:00')
    ),
]);
```

Dev
---

[](#dev)

### Run unit tests

[](#run-unit-tests)

```
make unit-tests
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

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

Total

3

Last Release

2743d ago

### Community

Maintainers

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

---

Top Contributors

[![nmarniesse](https://avatars.githubusercontent.com/u/4737390?v=4)](https://github.com/nmarniesse "nmarniesse (1 commits)")

### Embed Badge

![Health badge](/badges/nmarniesse-pomm-filter/health.svg)

```
[![Health](https://phpackages.com/badges/nmarniesse-pomm-filter/health.svg)](https://phpackages.com/packages/nmarniesse-pomm-filter)
```

###  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)[neos/flow

Flow Application Framework

862.0M451](/packages/neos-flow)[api-platform/metadata

API Resource-oriented metadata attributes and factories

223.5M96](/packages/api-platform-metadata)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[flowwow/cloudpayments-php-client

cloudpayments api client

2188.2k](/packages/flowwow-cloudpayments-php-client)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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