public function excluirImagemOS() { try { if (empty($_POST['id'])) { throw new \InvalidArgumentException("Favor selecionar uma Imagem."); } $imagemOS = new ImagemOS(); $imagemOS->id = $_POST['id']; $this->fachada->excluirImagemOS($imagemOS); echo new JSONResponse(true, "Imagem excluída com sucesso!"); } catch (\Exception $e) { echo new JSONResponse(false, $e->getMessage()); } }