public function apagarImagem(Imagem $imagem){

		$banco = $this->getBancoDados(); 

		if (strlen($imagem->getId())>0){
			$query = " DELETE FROM tbl_pergunta_imagem WHERE imagem = ".$imagem->getId();
			if(!$banco->updateSQL($query)) {
				throw new Exception("Erro ao apagar IMAGEM. ($query) "); 
			}
		}
	}
Example #2
0
 public function deletar(Imagem $img)
 {
     $where = "WHERE " . self::ID . " = '" . $img->getId() . "'";
     Arquivos::__DeleteArquivo($this->caminhoEscrita . $img->getImage()->nome . '.' . $img->getImage()->extensao);
     $this->con->deletar(Sistema::$BDPrefixo . $this->tabela, $where);
 }