Esempio n. 1
0
 public function alterar(Imagem $img)
 {
     $where = "WHERE " . self::ID . " = '" . $img->getId() . "'";
     $principal = $img->destaque ? self::VALOR_DESTAQUE_TRUE : self::VALOR_DESTAQUE_FALSE;
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::DESTAQUE, $principal, $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::LEGENDA, $img->legenda, $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::SESSAO, $img->getSessao(), $where);
     $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::IDSESSAO, $img->getIdSessao(), $where);
     if ($img->getImage()->nome != '') {
         $img->getImage()->open();
         $this->con->alterar(Sistema::$BDPrefixo . $this->tabela, self::IMAGEM, $img->getImage()->saveImage($this->caminhoEscrita), $where);
     }
 }