Prado\Data\Common\Sqlite\TSqliteCommandBuilder::applyLimitOffset PHP Метод

applyLimitOffset() публичный Метод

Alters the sql to apply $limit and $offset.
public applyLimitOffset ( $sql, $limit, $offset ) : string
Результат string SQL with limit and offset.
    public function applyLimitOffset($sql, $limit = -1, $offset = -1)
    {
        $limit = $limit !== null ? intval($limit) : -1;
        $offset = $offset !== null ? intval($offset) : -1;
        if ($limit > 0 || $offset > 0) {
            $limitStr = ' LIMIT ' . $limit;
            $offsetStr = $offset >= 0 ? ' OFFSET ' . $offset : '';
            return $sql . $limitStr . $offsetStr;
        } else {
            return $sql;
        }
    }
TSqliteCommandBuilder