protected function apiOffsetLimit(array $options = null)
    {
        if ($options === null) {
            $options = Input::all();
        }

        $offset = null;

        if (isset($options['offset'])) {
            $offset = (int) $options['offset'];
            $offset = $offset < 0 ? 0 : $offset;
        }

        $limit = isset($options['limit'])
            ? (int) $options['limit']
            : 0
        ;
        if ($limit < self::LIMIT_MIN) {
            $limit = self::LIMIT_DEFAULT;
        } elseif ($limit > self::LIMIT_MAX) {
            $limit = self::LIMIT_MAX;
        }

        if ($offset === null && isset($options['page'])) {
            $offset = ((int) $options['page'] - 1) * $limit;
            $offset = $offset < 0 ? 0 : $offset;
        }

        $offset ?: 0;

        return array($offset, $limit);
    }
protected function apiOffsetLimit(array $options = null)
    {
        if ($options === null) {
            $options = Input::all();
        }

        $offset = null;

        if (isset($options['offset'])) {
            $offset = (int) $options['offset'];
            $offset = $offset < 0 ? 0 : $offset;
        }

        $limit = isset($options['limit'])
            ? (int) $options['limit']
            : 0
        ;
        if ($limit < self::LIMIT_MIN) {
            $limit = self::LIMIT_DEFAULT;
        } elseif ($limit > self::LIMIT_MAX) {
            $limit = self::LIMIT_MAX;
        }

        if ($offset === null && isset($options['page'])) {
            $offset = ((int) $options['page'] - 1) * $limit;
            $offset = $offset < 0 ? 0 : $offset;
        }

        $offset ?: 0;

        return array($offset, $limit);
    }
protected function apiOffsetLimit ( array $ options = null ) { if ( $ options === null ) { $ options = Input :: all ( ) ; } $ offset = null ; if ( isset ( $ options [ 'offset' ] ) ) { $ offset = ( int ) $ options [ 'offset' ] ; $ offset = $ offset < 0 ? 0 : $ offset ; } $ limit = isset ( $ options [ 'limit' ] ) ? ( int ) $ options [ 'limit' ] : 0 ; if ( $ limit < self :: LIMIT_MIN ) { $ limit = self :: LIMIT_DEFAULT ; } elseif ( $ limit > self :: LIMIT_MAX ) { $ limit = self :: LIMIT_MAX ; } if ( $ offset === null && isset ( $ options [ 'page' ] ) ) { $ offset = ( ( int ) $ options [ 'page' ] - 1 ) * $ limit ; $ offset = $ offset < 0 ? 0 : $ offset ; } $ offset ? : 0 ; return array ( $ offset , $ limit ) ; }
Get the offset and limit to apply.

@param array $options The parameters (optional)

@return array Return offset and limit
Get the offset and limit to apply .