Пример #1
0
    exit;
}
if (count($obj->errors) != 7) {
    print_r($obj->errors);
    echo "validation 2 failed\n";
    exit;
}
if (!user::byId(1) instanceof user) {
    echo "wrong return type1";
}
if (!is_array(user::ArrayBuilder()->byId(1))) {
    echo "wrong return type2";
}
if (!is_array(product::join('user')->orderBy('products.id', 'desc')->get(2))) {
    echo "wrong return type2";
}
if (!is_array(product::orderBy('products.id', 'desc')->join('user')->get(2))) {
    echo "wrong return type2";
}
$u = new user();
if (!$u->byId(1) instanceof user) {
    echo "wrong return type2";
}
$p = new product();
if (!is_array($p->join('user')->orderBy('products.id', 'desc')->get(2))) {
    echo "wrong return type2";
}
if (!is_array($p->orderBy('products.id', 'desc')->join('user')->get(2))) {
    echo "wrong return type2";
}
echo "All done";
Пример #2
0
 public function json()
 {
     $this->list = product::join('user');
     return parent::json();
 }