소스 검색

remoteCheck

Luciano Andrade 7 년 전
부모
커밋
f574d1a7a2
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  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;
     }
 
 }