PHP code example of kartavik / limit-collection

1. Go to this page and download the library: Download kartavik/limit-collection library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kartavik / limit-collection example snippets




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
    }
}