public function setPagination($nextURL = null, $previousURL = null, $firstURL = null, $lastURL = null)
{
if (empty($nextURL) && empty($previousURL) && empty($firstURL) && empty($lastURL)) {
throw new \LogicException('At least one URL must be specified for pagination to work.');
}
if (!empty($nextURL)) {
$this->setAtomLink($nextURL, 'next');
}
if (!empty($previousURL)) {
$this->setAtomLink($previousURL, 'previous');
}
if (!empty($firstURL)) {
$this->setAtomLink($firstURL, 'first');
}
if (!empty($lastURL)) {
$this->setAtomLink($lastURL, 'last');
}
return $this;
}