public static function getComandas($offset, $limit) { $MesaDao = new MesaDao(); $comandas = $MesaDao->getComandas($offset, $limit, $_GET); if ($comandas) { Flight::json($comandas); } else { Flight::halt(404, 'Não a dados para a busca'); } }