Example #1
0
 public function inserirCombustivel($dados)
 {
     try {
         $this->em->beginTransaction();
         $combustivel = new CombustivelEntity();
         $combustivel->setDescricao($dados['descricao']);
         $this->em->persist($combustivel);
         $this->em->flush();
         $this->em->commit();
     } catch (Exception $exc) {
         if ($this->em->getConnection()->isTransactionActive()) {
             $this->em->rollback();
         }
         throw $exc;
     }
     return $combustivel;
 }
 public function jsonSerialize()
 {
     $this->__load();
     return parent::jsonSerialize();
 }