Selaa lähdekoodia

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

Espinoza Guillermo 6 vuotta sitten
vanhempi
commit
7d190db1c3
1 muutettua tiedostoa jossa 7 lisäystä ja 2 poistoa
  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);
+            }
         }
     }