コード例 #1
0
ファイル: Solicitante.php プロジェクト: Rodrigojorge/frota
 public function alterarSolicitante($dados)
 {
     try {
         $this->em->beginTransaction();
         //$solicitante = $this->getRepository()->findById($dados['_id']);
         $this->removerSolicitante($dados['_id']);
         $solicitante = new SolicitanteEntity();
         $solicitante->setServidor($this->em->getReference("Frota\\Model\\Entity\\Servidor", $dados['servidor']['matricula']));
         $solicitante->setLotacao($this->em->getReference("Frota\\Model\\Entity\\Lotacao", $dados['lotacao']['codigo']));
         $this->em->persist($solicitante);
         $this->em->flush();
         $this->em->commit();
     } catch (Exception $exc) {
         if ($this->em->getConnection()->isTransactionActive()) {
             $this->em->rollback();
         }
         throw $exc;
     }
     return $solicitante;
 }
コード例 #2
0
 public function jsonSerialize()
 {
     $this->__load();
     return parent::jsonSerialize();
 }