eZ\Publish\Core\Persistence\Database\SelectQuery::limit PHP Method

limit() public method

$limit controls the maximum number of rows that will be returned. $offset controls which row that will be the first in the result set from the total amount of matching rows. Example: $q->select( '*' )->from( 'table' ) ->limit( 10, 0 ); LIMIT is not part of SQL92. It is implemented here anyway since all databases support it one way or the other and because it is essential.
public limit ( string $limit, string $offset = '' ) : eZ\Publish\Core\Persistence\Database\SelectQuery
$limit string integer expression
$offset string integer expression
return eZ\Publish\Core\Persistence\Database\SelectQuery
    public function limit($limit, $offset = '');

Usage Example

 /**
  * Loads field data for given $pass.
  *
  * @param \eZ\Publish\Core\Persistence\Database\SelectQuery $query
  * @param int $bulkCount
  * @param int $pass
  *
  * @return array
  */
 protected function loadData(SelectQuery $query, $bulkCount, $pass)
 {
     $query->limit($bulkCount, $pass * $bulkCount);
     $stmt = $query->prepare();
     $stmt->execute();
     return $stmt->fetchAll(PDO::FETCH_ASSOC);
 }