PHPackages                             aelfannir/doctrine-api-paginator - 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. aelfannir/doctrine-api-paginator

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

aelfannir/doctrine-api-paginator
================================

Simple, powerful package for search, sort, filter &amp; paginate database

0.3.0(4y ago)013MITPHPPHP &gt;=8.0

Since Jun 23Pushed 4y ago1 watchersCompare

[ Source](https://github.com/aelfannir/doctrine-query-paginator)[ Packagist](https://packagist.org/packages/aelfannir/doctrine-api-paginator)[ RSS](/packages/aelfannir-doctrine-api-paginator/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (11)Versions (35)Used By (0)

Installation
============

[](#installation)

Make sure Composer is installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Applications that use Symfony Flex
----------------------------------

[](#applications-that-use-symfony-flex)

Open a command console, enter your project directory and execute:

```
$ composer require aelfannir/doctrine-query-paginator
```

Applications that don't use Symfony Flex
----------------------------------------

[](#applications-that-dont-use-symfony-flex)

### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
$ composer require aelfannir/doctrine-query-paginator
```

### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `config/bundles.php` file of your project:

```
// config/bundles.php

return [
    // ...
    AElfannir\DoctrineQueryPaginator\DoctrineQueryPaginatorBundle::class => ['all' => true],
];
```

Docs
====

[](#docs)

---

Filter
======

[](#filter)

Filters describe conditions on table property values to include in the results from a database query.

A filter can be a **property filter** or it can be a compound filter formed by joining mtuliple **property filters** using a logical `"AND"` or `"OR"` operation.

**Compound filters** can be nested.

Property filters
----------------

[](#property-filters)

### `property`

[](#property)

Type `string`, The name or ID of the property to filter on.

### `operator`

[](#operator)

Type `string`, The operator ID used to generate comparision expression. Possible values include;

OperatorTypeDescriptionExample value`STRING.EQ``string`Returns records where the property value matches the provided value exactly.`"hello world"``STRING.NEQ``string`Returns records where the property value doesn't match the provided value exactly.`"hello world"``STRING.CONTAINS``string`Returns records where the property value contains the provided value.`"world"``STRING.DOES_NOT_CONTAIN``string`Returns records where the property value doesn't contains the provided value.`"hello world"``STRING.STARTS_WITH ``string`Returns records where the property value starts with the provided value.`"world"``STRING.ENDS_WITH  ``string`Returns records where the property value ends with the provided value.`"hello"``STRING.DOES_NOT_START_WITH``string`Returns records where the property value doesn't start with the provided value.`"hello"``STRING.DOES_NOT_END_WITH``string`Returns records where the property value doesn't end with the provided value.`"world"``STRING.IN``array`Returns records where the property value is one of the provided values.`["hellow world, "foo"]``STRING.NOT_IN``array`Returns records where the property value isn't one of the provided values.`["hellow world, "foo"]``STRING.IS_NULL`Returns records where the property value is null. Note that the value sent will be ignored`STRING.IS_NOT_NULL`Returns records where the property value is not null. Note that the value sent will be ignored`NUMBER.EQ``number`Returns records where the property value matches the provided value exactly.`101``NUMBER.NEQ``number`Returns records where the property value doesn't match the provided value exactly.`101.5``NUMBER.GT``number`Returns records where the property value is greater than the provided value.`101``NUMBER.GTE``number`Returns records where the property value is greater than or equals to the provided value.`101``NUMBER.LT``number`Returns records where the property value is less than the provided value.`101``NUMBER.LTE``number`Returns records where the property value is less than or equals t the provided value.`101``NUMBER.IN``number`Returns records where the property value is one of the provided values.`[102, 101]``NUMBER.NOT_IN``number`Returns records where the property value is one of the provided values. Note that the value sent will be ignored`[12, 101]``NUMBER.IS_NULL`Returns records where the property value is null. Note that the value sent will be ignored, Note that the value sent will be ignored`NUMBER.IS_NOT_NULL`Returns records where the property value is not null. Note that the value sent will be ignored`DATETIME.EQ``string "YYYY-MM-DD hh:mm:ss"`Returns records where the property value matches the provided date exactly. Note that any time information sent will be ignored when the property values's type is date.`"2021-12-24 10:30:00"``DATETIME.NEQ``string "YYYY-MM-DD hh:mm:ss"`Returns records where the property value doesn't match the provided date exactly. Note that any time information sent will be ignored when the property values's type is date.`"2021-12-24 10:30:00"``DATETIME.GT``string "YYYY-MM-DD hh:mm:ss"`Returns records where the property value is after the provided date. Note that any time information sent will be ignored when the property values's type is date.`"2021-12-24 10:30:00"``DATETIME.GTE``string "YYYY-MM-DD hh:mm:ss"`Returns records where the property value is on or after the provided date. Note that any time information sent will be ignored when the property values's type is date.`"2021-12-24 10:30:00"``DATETIME.LT``string "YYYY-MM-DD hh:mm:ss"`Returns records where the property value is before the provided date. Note that any time information sent will be ignored when the property values's type is date.`"2021-12-24 10:30:00"``DATETIME.LTE``string "YYYY-MM-DD hh:mm:ss"`Returns records where the property value is on or before the provided date. Note that any time information sent will be ignored when the property values's type is date.`"2021-12-24 10:30:00"``DATETIME.IN``array`Returns records where the property value is one of the provided dates.`["2021-01-01 00:00:00", "2021-12-31 23:59:59"]``DATETIME.NOT_IN``array`Returns records where the property value is not in the provided dates.`["2021-01-01 00:00:00", "2021-12-31 23:59:59"]``DATETIME.IS_NULL`Returns records where the property value is null. Note that the value sent will be ignored`DATETIME.IS_NOT_NULL`Returns records where the property value is not null. Note that the value sent will be ignored`BOOL.EQ``bool`Returns records where the property value matches the provided value exactly.`true``RELATION.EQ``number`Returns records where the relation id matches the provided value exactly.`1``RELATION.NEQ``number`Returns records where the relation id doesn't match the provided value exactly.`102``RELATION.IS_NULL`Returns records where the property value is null. Note that the value sent will be ignored`RELATION.IS_NOT_NULL`Returns records where the property value is not null. Note that the value sent will be ignored### `value`

[](#value)

Can be one of the following types `array`, `string` or `number`

### Examples

[](#examples)

```
{
  "filter": {
    "operator": "AND",
    "filters": [
      {
        "property": "createdAt",
        "operator": "DATETIME.GTE",
        "value": "2021-01-01 00:00"
      },
			{
        "property": "createdAt",
        "operator": "DATETIME.LT",
        "value": "2022-01-01 00:00"
      }
    ]
  }
}
```

Compound filters
----------------

[](#compound-filters)

A **compound filter** object combines several database **property filters** together. A **compound filter** can even be combined within a **compound filter.**

The **compound filter** object contains one of the following keys:

### `operator`

[](#operator-1)

The condition used to combine `filters`, can be `"AND"` or `"OR"`

### `filters`

[](#filters)

`array` of **property filters**

### Examples

[](#examples-1)

```
{
  "filter": {
    "operator": "OR",
    "filters": [
      {
        "property": "firstName",
        "operator": "STRING.EQ",
        "value": "Mohammed"
      },
      {
        "operator": "AND",
        "filters": [
          {
            "property": "createdAt",
            "operator": "DATETIME.GTE",
            "value": "2021-01-01 00:00"
          },
          {
            "property": "createdAt",
            "operator": "DATETIME.LT",
            "value": "2022-01-01 00:00"
          }
        ]
      }
    ]
  }
}
```

Search
======

[](#search)

Type `string`, search in the target table root's properties

### Example

[](#example)

```
{
  "search": "foo"
}
```

Pagination
==========

[](#pagination)

Type `object` should contain the metadata that required for the datatable pagination to work.

### `pagination.page`

[](#paginationpage)

Type `number`, The current page number.

### `pagination.pages`

[](#paginationpages)

Type `number`, Total number of pages available in the server.

### `pagination.perPage`

[](#paginationperpage)

Type `number`, The current page number.

### `pagination.total`

[](#paginationtotal)

Type `number`, Total all records number available in the server

### Example

[](#example-1)

- Request

```
{
  "pagination": {
    "page": 1,
    "perPage": 10
  }
}
```

- Response

```
{
  "pagination": {
    "page": 1,
    "perPage": 10,
    "total": 100,
    "pages": 10
  }
}
```

Sorts
=====

[](#sorts)

Sort objects describe the order of database query results. The Query a database endpoint accepts an `array` of sort objects in the sorts body parameter. In the array, the lower index object takes precedence. Each sort object contains the following keys

### `property`

[](#property-1)

Type `string`, The name of the property to sort against.

### `direction`

[](#direction)

The direction to sort. Possible values include `"ASC"` and `"DESC"`.

### Example

[](#example-2)

```
{
  "sorts": [
    {
      "property": "firstName",
      "direction": "ASC"
    },
    {
      "property": "lastName",
      "direction": "DESC"
    }
  ]
}
```

Join
====

[](#join)

### `table`

[](#table)

Type `string`, join table name.

### `alias`

[](#alias)

optional, type `string`, note that when alias is undifined table's value is used as ajoin table's alias

### `join`

[](#join-1)

optional, `array` of **join** conditions,

### Example

[](#example-3)

```
{
  "join": [
    {
      "table": "category",
      "join": [
        {
          "table": "parent",
          "alias": "subCategory",
          "join": [
            {
              "table": "parent",
              "alias": "subCategory2"
            }
          ]
        }
      ]
    }
  ]
}
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Recently: every ~10 days

Total

34

Last Release

1723d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/665a279c538d304a66e3a6174be9ea98d9a5c59b50cdd4c926514f89b5b15457?d=identicon)[aelfannir](/maintainers/aelfannir)

---

Top Contributors

[![aelfannir](https://avatars.githubusercontent.com/u/38046657?v=4)](https://github.com/aelfannir "aelfannir (58 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aelfannir-doctrine-api-paginator/health.svg)

```
[![Health](https://phpackages.com/badges/aelfannir-doctrine-api-paginator/health.svg)](https://phpackages.com/packages/aelfannir-doctrine-api-paginator)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)[forumify/forumify-platform

121.8k11](/packages/forumify-forumify-platform)[kadirov/api-starter-kit

443.9k](/packages/kadirov-api-starter-kit)

PHPackages © 2026

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