public function deletar(BannerCategoria $t) { if ($t->getBanners()->getTotal() > 0) { throw new Exception("Está categoria possui banners cadastrados, não foi possível removê-la!"); } else { parent::deletar($t); $where = "WHERE " . self::ID . " = '" . $t->getId() . "'"; $this->con->deletar(Sistema::$BDPrefixo . $this->tabela, $where); } }