silverstripe-framework/src/ORM/Limitable.php

29 lines
805 B
PHP
Raw Normal View History

<?php
namespace SilverStripe\ORM;
/**
* Additional interface for {@link SS_List} classes that are limitable - able to have a subset of the list extracted.
*
* All methods in this interface are immutable - they should return new instances with the limit
* applied, rather than applying the limit in place
*
2020-12-21 22:23:23 +01:00
* @see SS_List
* @see Sortable
* @see Filterable
*/
2016-11-29 00:31:16 +01:00
interface Limitable extends SS_List
{
2016-11-29 00:31:16 +01:00
/**
* Returns a new instance of this list where no more than $limit records are included.
* If $offset is specified, then that many records at the beginning of the list will be skipped.
* This matches the behaviour of the SQL LIMIT clause.
*
* @param int $limit
* @param int $offset
* @return static
*/
public function limit($limit, $offset = 0);
}