Example #1
0
 public function addCategoria(SlideCategoria $sC)
 {
     if ($sC->getId() != '' && $this->getId() != '') {
         $con = BDConexao::__Abrir();
         $con->executar("INSERT INTO " . Sistema::$BDPrefixo . "relacionamento_slides_categorias(slide, categoria) VALUES('" . $this->getId() . "','" . $sC->getId() . "')");
     }
 }
 public function deletar(SlideCategoria $t)
 {
     if ($t->getBanners()->getTotal() > 0) {
         throw new Exception("Está categoria possui slides 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);
     }
 }