An extension of DoctrinePaginator to make it work when ids are binary uuids generated with ramsey/uuid

1.0.3 2020-02-10 14:36 UTC

This package is auto-updated.

Last update: 2022-01-10 19:11:39 UTC


Doctrine's Paginator fails to return objects if their id is of uuid_binary type.

This happens because the database won't match a BINARY(16) to a string.

The solution was to get those ids (which were converted by UuidInterface::__toString) and return them with UuidInterface::getBytes. This allows for a proper match at the database level.

Current build status

Build Status Coverage Status Mutation testing badge Scrutinizer Code Quality Downloads


composer require alextartan/doctrine-paginator-ramsey-binary-uuid


$repo = $this->em->getRepository(SomeEntity::class);
$query = $repo->createQueryBuilder('se')
              // more stuff here

$p = new BinaryUuidSafePaginator($query);


This library adheres to semver