Пример #1
0
        $args[] = get_magic_quotes_gpc() ? stripslashes($body->{$argname}) : $body->{$argname};
    }
}
if (isset($body->_count) && $body->_count === true) {
    $args[] = $base->count();
}
if (isset($body->_order)) {
    if (is_object($body->_order)) {
        $args[] = $base->order($body->_order->col, strtoupper($body->_order->order));
    } else {
        $args[] = $base->order($body->_order);
    }
}
if (isset($body->_limit)) {
    if (is_object($body->_limit)) {
        $args[] = $base->limit($body->_limit->limit, $body->_limit->offset);
    } else {
        $args[] = $base->limit($body->_limit);
    }
}
if (isset($body->_distinct)) {
    $args[] = $base->distinct();
}
try {
    $results = $base->{$schema}->__call($function, $args);
} catch (PgProcFunctionNotAvailableException $e) {
    header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");
    echo $e->getMessage();
    exit;
} catch (PgProcException $e) {
    header($_SERVER["SERVER_PROTOCOL"] . " 400 Bad Request");
Пример #2
0
 public function testLimitOffset()
 {
     $in = array(1, 3, 2, 4);
     $out = self::$base->pgtests->test_integer_array_arg($in, PgProcedures2::limit(2, 1));
     $this->assertSame(array(3, 2), $out);
 }