pagerwave/doctrine-collections-extension

This package is abandoned and no longer maintained. No replacement package was suggested.

PagerWave extension for Doctrine Collections support

v2.1.0 2023-01-20 23:07 UTC

This package is auto-updated.

Last update: 2023-06-18 13:23:32 UTC


README

This package lets you paginate Doctrine Collections objects using PagerWave.

Installation

$ composer require pagerwave/doctrine-collections-extension

Usage

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Criteria;
use PagerWave\Extension\DoctrineCollections\SelectableAdapter;

// Any collection that implements the Selectable interface works,
// including Doctrine ORM repositories, and persisted collections.
$collection = new ArrayCollection();

// Optionally, provide criteria as the second argument to the adapter.
$criteria = Criteria::create()
    ->where(Criteria::expr()->eq('visible', true));

$adapter = new SelectableAdapter($collection, $criteria);

Read the PagerWave documentation to learn more.

Licence

This project is released under the Zlib licence.