浏览代码

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);
+            }
         }
     }