Example #1
0
 public function editar_template(Template $template)
 {
     try {
         $this->getDb()->beginTransaction();
         $sql = 'UPDATE testes.template set template_nome = :template_nome 
             WHERE pk_template = :pk_template';
         $prepare = $this->getDb()->prepare($sql);
         $prepare->bindParam(':pk_template', $template->get_pk_template(), PDO::PARAM_INT);
         $prepare->bindParam(':template_nome', $template->get_template_nome(), PDO::PARAM_STR, 50);
         $prepare->execute();
         $idTemplate = $prepare->fetch();
         $this->getDb()->commit();
     } catch (Exception $e) {
         var_dump($e);
         die;
         $this->getDb()->rollBack();
         throw new Exception($e->getMessage());
     }
 }