소스 검색

chequeo si esta eliminada onu para prevenir asignación de service ports liberados

Espinoza Guillermo 6 년 전
부모
커밋
7d190db1c3
1개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 7 2
      src/FTTHBundle/EventListener/ONUSubscriber.php

+ 7 - 2
src/FTTHBundle/EventListener/ONUSubscriber.php

@@ -75,7 +75,9 @@ class ONUSubscriber implements EventSubscriber
         $entity = $args->getEntity();
         if ($entity instanceof ONU) {
             $this->em = $args->getEntityManager();
-            $this->setServicePorts($entity);
+            if (!$entity->isDeleted()) {
+                $this->setServicePorts($entity);
+            }
         }
     }
 
@@ -95,7 +97,10 @@ class ONUSubscriber implements EventSubscriber
         $entity = $args->getEntity();
         if ($entity instanceof ONU) {
             $this->em = $args->getEntityManager();
-            $this->setServicePorts($entity);
+            
+            if (!$entity->isDeleted()) {
+                $this->setServicePorts($entity);
+            }
         }
     }