public function alterar(Permissao $objPermissao) { $v = $this->_getValidacao(); $v->setRules($objPermissao->getId(), 'required', 'ID'); $v->setRules($objPermissao->getNome(), 'required', 'NOME'); $v->setRules($objPermissao->getStatus(), 'required', 'STATUS'); $v->validar(); return $this->_getRepositorio()->alterar($objPermissao); }
public function alterar(Permissao $objPermissao) { try { $this->_stat = $this->_getConn()->prepare('UPDATE tblpermissao SET per_nome = :per_nome, per_status = :per_status WHERE per_id = :per_id'); $this->_stat->bindValue(':per_id', $objPermissao->getId(), \PDO::PARAM_INT); $this->_stat->bindValue(':per_nome', $objPermissao->getNome(), \PDO::PARAM_STR); $this->_stat->bindValue(':per_status', $objPermissao->getStatus(), \PDO::PARAM_INT); $this->_stat->execute(); return true; } catch (\PDOException $e) { throw new \model\conexao\Excecao($e->getMessage()); } }