public function retrieve() { $args = $this->request->args; if (isset($args['id'])) { $id = Validate::uint($args['id']); $order = Order::retrieve($id); $this->response->set('order', $order); } else { $orders = Order::retrieve(); $this->response->set('orders', $orders); } }