pagerwave / doctrine-collections-extension
Doctrine Collections 支持的 PagerWave 扩展
v2.2.0
2024-06-08 09:42 UTC
Requires
- php: 7.2.*|7.3.*|7.4.*|8.0.*|8.1.*|8.2.*|8.3.*
- doctrine/collections: ^1.4|^2.0
- postmill/pagerwave: ^2.0
Requires (Dev)
- phpunit/phpunit: ^8.5
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 许可证发布。