Offset
This trait provides functionality to set and get an offset value for a query.
- Full name:
\Zemit\Mvc\Controller\Traits\Query\Offset
Properties
offset
protected ?int $offset
Methods
initializeOffset
Initializes the offset value.
public initializeOffset(): void
Sets the offset value using the provided parameter's value, after filtering it through the specified filter, or sets it to the default offset value if no offset parameter is provided.
Throws:
setOffset
Sets the offset value for the query.
public setOffset(int|null $offset): void
Parameters:
Parameter | Type | Description |
---|---|---|
$offset | **int | null** |
Throws:
If the specified offset value is less than 0.
getOffset
Returns the offset value.
public getOffset(): int|null
Return Value:
The offset value. Returns either an integer representing the offset value or null if no offset is set.
defaultOffset
Returns the default offset value.
public defaultOffset(): int|null
Return Value:
The default offset value. Returns either an integer representing the offset value or null if no offset is set.