limit method

QueryBuilder limit(
  1. int limitCount
)

Limits the max number of objects returned from the database, namely defines the page size for pagination. In combination with page, primarily used to paginate through your data. Even if you do not specify a limit in your database queries, Altogic automatically limits the number of objects returned from the database by setting the default limits.

If multiple limit method calls are chained then the last one overwrites the previous limit values.

limitCount An integer that specifies the max number of objects to return Returns the QueryBuilder itself so that you can chain other methods

Implementation

QueryBuilder limit(int limitCount) {
  if (limitCount == 0) {
    throw ClientError('invalid_limit', 'Limit value needs to be at least 1.');
  }

  _action.limit = limitCount;
  return this;
}