Jelajahi Sumber

remoteCheck

Luciano Andrade 7 tahun lalu
induk
melakukan
f574d1a7a2
1 mengubah file dengan 3 tambahan dan 3 penghapusan
  1. 3 3
      EventListener/DeviceListener.php

+ 3 - 3
EventListener/DeviceListener.php

@@ -119,7 +119,7 @@ class DeviceListener
      */
     private function addLocationData($entity, $data)
     {
-	$this->enabled = true;
+	if(!$this->enabled) return ;
 
         $locationInterface = 'MapBundle\Entity\Interfaces\LocationInterface';
         if (interface_exists($locationInterface) && is_a($entity, $locationInterface)) {
@@ -136,7 +136,7 @@ class DeviceListener
      */
     private function getRemoteDeviceId($entity) 
     {
-	$this->enabled = true;
+	if(!$this->enabled) return ;
 
         $deviceId = $entity->getId();
         $deviceType = get_class($entity);
@@ -156,7 +156,7 @@ class DeviceListener
     }
 
     function remoteCheck($enabled = true){
-	$this->enabled = true;
+	$this->enabled = $enabled;
     }
 
 }