eee
This commit is contained in:
@@ -501,4 +501,33 @@ class ConstrictRequest extends Message implements RequestInterface, ServerReques
|
|||||||
// TODO: Implement withoutAttribute() method.
|
// TODO: Implement withoutAttribute() method.
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function offset(): int
|
||||||
|
{
|
||||||
|
$params = $this->getQueryParams();
|
||||||
|
$page = (int)($params['page'] ?? 1);
|
||||||
|
$size = $this->size();
|
||||||
|
if ($page < 1) {
|
||||||
|
$page = 1;
|
||||||
|
}
|
||||||
|
return ($size - $page) * $page;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function size(): int
|
||||||
|
{
|
||||||
|
$params = $this->getQueryParams();
|
||||||
|
$size = (int)($params['size'] ?? 1);
|
||||||
|
if ($size < 1) {
|
||||||
|
$size = 1;
|
||||||
|
}
|
||||||
|
return $size;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -776,4 +776,22 @@ class Request implements ServerRequestInterface
|
|||||||
// TODO: Implement withoutAttribute() method.
|
// TODO: Implement withoutAttribute() method.
|
||||||
return $this->__call__(__FUNCTION__, $name);
|
return $this->__call__(__FUNCTION__, $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function offset(): int
|
||||||
|
{
|
||||||
|
return $this->__call__(__FUNCTION__);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function size(): int
|
||||||
|
{
|
||||||
|
return $this->__call__(__FUNCTION__);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user