2012-03-09 02:02:37 +01:00
|
|
|
<?php
|
|
|
|
|
2016-06-15 06:03:16 +02:00
|
|
|
namespace SilverStripe\ORM;
|
|
|
|
|
2012-03-09 02:02:37 +01:00
|
|
|
/**
|
|
|
|
* Additional interface for {@link SS_List} classes that are limitable - able to have a subset of the list extracted.
|
2012-07-20 04:51:12 +02:00
|
|
|
*
|
|
|
|
* All methods in this interface are immutable - they should return new instances with the limit
|
|
|
|
* applied, rather than applying the limit in place
|
|
|
|
*
|
2012-03-09 02:02:37 +01:00
|
|
|
* @see SS_List, SS_Sortable, SS_Filterable
|
|
|
|
*/
|
2014-07-30 01:07:01 +02:00
|
|
|
interface SS_Limitable extends SS_List {
|
2012-03-09 02:02:37 +01:00
|
|
|
|
|
|
|
/**
|
2012-12-12 05:22:45 +01:00
|
|
|
* Returns a new instance of this list where no more than $limit records are included.
|
2012-03-09 02:02:37 +01:00
|
|
|
* 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.
|
2014-07-30 01:07:01 +02:00
|
|
|
*
|
2016-08-19 00:51:35 +02:00
|
|
|
* @param int $limit
|
|
|
|
* @param int $offset
|
|
|
|
* @return static
|
2012-03-09 02:02:37 +01:00
|
|
|
*/
|
|
|
|
public function limit($limit, $offset = 0);
|
|
|
|
|
2012-03-24 04:04:52 +01:00
|
|
|
}
|