فهرست منبع

Refactory listener. Se agrego método en Interface

Guillermo Espinoza 8 سال پیش
والد
کامیت
bf1029b73d
2فایلهای تغییر یافته به همراه4 افزوده شده و 6 حذف شده
  1. 2 6
      EventListener/DeviceListener.php
  2. 2 0
      Interfaces/DeviceInterface.php

+ 2 - 6
EventListener/DeviceListener.php

@@ -55,7 +55,7 @@ class DeviceListener
     }
 
     /**
-     * @param LifecycleEventArgs $arg
+     * @param LifecycleEventArgs $args
      * @param string $url
      * @param string $method
      */
@@ -63,11 +63,7 @@ class DeviceListener
     {
         $entity = $args->getEntity();
         if ($entity instanceof DeviceInterface) {
-            $data = array(
-                'deviceType' => get_class($entity),
-                'deviceId' => $entity->getId(),
-                'ip' => $entity->getIp(),
-            );
+            $data = $entity->getDeviceData();
 
             return $this->webservice->makeGetRequest($url, $method, $data);
         }

+ 2 - 0
Interfaces/DeviceInterface.php

@@ -4,4 +4,6 @@ namespace DeviceBundle\Interfaces;
 
 interface DeviceInterface
 {
+
+    public function getDeviceData();
 }