tabela = (string) $tabela; $this->termos = (string) $termos; parse_str($parseString, $this->values); $this->getInstrucao(); $this->executarInstrucao(); } public function getResult() { return $this->result; } public function getMsg() { return $this->msg; } public function getRowCount() { return $this->query->rowCount(); } private function conexao() { $this->conn = parent::getConn(); $this->query = $this->conn->prepare($this->query); } private function getInstrucao() { $this->query = "DELETE FROM {$this->tabela} {$this->termos}"; } private function executarInstrucao() { $this->conexao(); try { $this->query->execute($this->values); $this->result = true; $this->msg = "
Usuário apagado com sucesso!
"; } catch (Exception $e) { $this->result = null; $this->msg = "
Erro ao Apagar {$e->getMessage()}
"; } } }