Procházet zdrojové kódy

Fixed the problem when we changed the onu status

Jean Sumara před 5 roky
rodič
revize
862b58af16
1 změnil soubory, kde provedl 1 přidání a 4 odebrání
  1. 1 4
      src/FTTHBundle/EventListener/ONUSubscriber.php

+ 1 - 4
src/FTTHBundle/EventListener/ONUSubscriber.php

@@ -87,10 +87,7 @@ class ONUSubscriber implements EventSubscriber
         try{
             $entity = $args->getEntity();
             if($entity instanceof ONU){
-                $dm = $this->containerInterface->get("doctrine")->getManager();
-                $uow = $dm->getUnitOfWork();
-                $originalEntity = $uow->getOriginalEntityData($entity);
-                if($originalEntity['clientId'] != $entity->getClientId()){
+                if(isset($args->getEntityChangeSet()['clientId']) && $args->getOldValue('clientId') != $entity->getClientId()){
                     $this->setStateOnu($entity);
                 }
             }