Commit 3c19673db04644b6b7013588ab4c17d300e9487f
Exists in
master
and in
1 other branch
Merge branch 'master' of https://github.com/lightbase/cacic
Showing
1 changed file
with
7 additions
and
0 deletions
Show diff stats
src/Cacic/WSBundle/Controller/ColetaController.php
| @@ -602,6 +602,13 @@ class ColetaController extends Controller | @@ -602,6 +602,13 @@ class ColetaController extends Controller | ||
| 602 | $softwareObject = $this->getDoctrine()->getRepository('CacicCommonBundle:Software')->findOneBy( array( 'nmSoftware' => $nmSoftware ) ); | 602 | $softwareObject = $this->getDoctrine()->getRepository('CacicCommonBundle:Software')->findOneBy( array( 'nmSoftware' => $nmSoftware ) ); |
| 603 | if (empty($softwareObject)) { | 603 | if (empty($softwareObject)) { |
| 604 | $softwareObject = new Software(); | 604 | $softwareObject = new Software(); |
| 605 | + // Se não tiver nome coloco o ID Software no nome | ||
| 606 | + if (empty($arrTagsNames['DisplayName'])) { | ||
| 607 | + $softwareObject->setNmSoftware($softwareName); | ||
| 608 | + } else { | ||
| 609 | + $softwareObject->setNmSoftware($arrTagsNames['DisplayName']); | ||
| 610 | + } | ||
| 611 | + | ||
| 605 | // Grava software recém inserido | 612 | // Grava software recém inserido |
| 606 | $this->getDoctrine()->getManager()->persist($softwareObject); | 613 | $this->getDoctrine()->getManager()->persist($softwareObject); |
| 607 | $this->getDoctrine()->getManager()->flush(); | 614 | $this->getDoctrine()->getManager()->flush(); |