Creates a pagination result from a single object implementing PaginationResultParams.
Parameter object containing page, perPage, and total count.
Creates a pagination result from a Pagination instance and a total count.
The Pagination instance specifying page and perPage.
The total number of items.
OptionalnextThe page index for the next page, or undefined if on the last page.
The 1-based index of the current page.
The maximum number of items per page.
OptionalprevThe page index for the previous page, or undefined if on the first page.
The total number of items matching the query.
The total number of pages calculated from total and perPage.
Implements the JSON.stringify() behavior.
It uses toStruct to get the plain object structure under the hood.
It is encouraged to use toStruct instead of this method because it provides better
clarity and expressiveness about the data structure being serialized. This method is provided
only to support the JSON.stringify() serialization.
A plain object structure containing the model's serializable properties.
Converts the model instance into a plain data structure (struct).
This method extracts the model's property data, removing functions, methods, or class-specific instance details, returning a clean structural representation.
A plain object structure containing the model's serializable properties.
Represents the result of a paginated query, detailing metadata about pages and total counts.
Example
Creating a pagination result from standard pagination and total count