コード例 #1
0
ファイル: Controlador.php プロジェクト: ebelmiro/fase
 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);
 }
コード例 #2
0
ファイル: Repositorio.php プロジェクト: ebelmiro/fase
    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());
        }
    }