Gdn_SQLDriver::limit PHP 메소드

limit() 공개 메소드

Sets the limit (and offset optionally) for the query.
public limit ( integer $Limit, integer $Offset = false ) : Gdn_SQLDriver
$Limit integer The number of records to limit the query to.
$Offset integer The offset where the query results should begin.
리턴 Gdn_SQLDriver $this
    public function limit($Limit, $Offset = false)
    {
        // SQL chokes on ints over 2^31
        if ($Limit > self::MAX_SIGNED_INT) {
            throw new Exception(t('Invalid limit.'), 400);
        }
        $this->_Limit = $Limit;
        if ($Offset !== false) {
            $this->offset($Offset);
        }
        return $this;
    }