From 1aa8652235ea41a4935045d57a822e0c773ef62f Mon Sep 17 00:00:00 2001 From: Eduardo Santos Date: Wed, 16 Apr 2014 18:25:05 -0300 Subject: [PATCH] Corrige erro na coleta de software --- src/Cacic/WSBundle/Controller/ColetaController.php | 7 +++++++ 1 file changed, 7 insertions(+), 0 deletions(-) diff --git a/src/Cacic/WSBundle/Controller/ColetaController.php b/src/Cacic/WSBundle/Controller/ColetaController.php index d5036d7..db2741d 100644 --- a/src/Cacic/WSBundle/Controller/ColetaController.php +++ b/src/Cacic/WSBundle/Controller/ColetaController.php @@ -602,6 +602,13 @@ class ColetaController extends Controller $softwareObject = $this->getDoctrine()->getRepository('CacicCommonBundle:Software')->findOneBy( array( 'nmSoftware' => $nmSoftware ) ); if (empty($softwareObject)) { $softwareObject = new Software(); + // Se não tiver nome coloco o ID Software no nome + if (empty($arrTagsNames['DisplayName'])) { + $softwareObject->setNmSoftware($softwareName); + } else { + $softwareObject->setNmSoftware($arrTagsNames['DisplayName']); + } + // Grava software recém inserido $this->getDoctrine()->getManager()->persist($softwareObject); $this->getDoctrine()->getManager()->flush(); -- libgit2 0.21.2