for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Spiral Framework.
*
* @license MIT
* @author Anton Titov (Wolfy-J)
*/
declare(strict_types=1);
namespace Spiral\Pagination\Traits;
* Common functionality with ability to limit selection and specify offsets.
trait LimitsTrait
{
* @var int
private $limit = 0;
private $offset = 0;
* Set selection limit. Attention, this limit value does not affect values set in paginator but
* only changes pagination window. Set to 0 to disable limiting.
* @param int $limit
* @return $this
public function limit(int $limit = 0)
$this->limit = $limit;
return $this;
}
* @return int
public function getLimit(): int
return $this->limit;
* Set selection offset. Attention, this value does not affect associated paginator but only
* changes pagination window.
* @param int $offset
* @return mixed
public function offset(int $offset = 0)
$this->offset = $offset;
public function getOffset(): int
return $this->offset;