|
@@ -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;
|
|
|
}
|
|
|
|
|
|
}
|