pagerwave/doctrine-collections-extension

Doctrine Collections 支持的 PagerWave 扩展

v2.2.0 2024-06-08 09:42 UTC

This package is auto-updated.

Last update: 2024-09-08 10:28:53 UTC


README

此包允许您使用 Doctrine Collections 对象进行分页,使用 PagerWave

安装

$ composer require pagerwave/doctrine-collections-extension

用法

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);

阅读 PagerWave 文档 了解更多信息。

许可证

本项目采用 Zlib 许可证发布。