Explorar el Código

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

Espinoza Guillermo hace 6 años
padre
commit
7d190db1c3
Se han modificado 1 ficheros con 7 adiciones y 2 borrados
  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);
+            }
         }
     }