kartavik/limit-collection

具有限制大小的基本集合

1.0.1 2019-07-15 13:02 UTC

This package is auto-updated.

Last update: 2024-09-13 02:08:21 UTC


README

codecov Latest Stable Version Total Downloads License

基于 BaseCollection

安装

composer require kartavik/limit-collection

用法

<?php

use Kartavik\LimitCollection;

class CustomCollection extends LimitCollection
{
    public function type() : string
    {
        return stdClass::class; // see Wearesho\BaseCollection
    }
    
    public function limit() : int
    {
        return 5; // here you can put hardcode limit of collection
    }
}

作者

许可