Browse Source

FD3-140 Se agrega relación inversa de DeviceServer(error que mostraba el
log de doctrine) y se actualiza composer.lock y OnuAdmin

Maximiliano Schvindt 7 years ago
parent
commit
93309f5c1f
3 changed files with 40 additions and 5 deletions
  1. 2 2
      composer.lock
  2. 3 3
      src/StatsBundle/Admin/OnuAdmin.php
  3. 35 0
      src/StatsBundle/Entity/DeviceServer.php

+ 2 - 2
composer.lock

@@ -1447,7 +1447,7 @@
             "source": {
                 "type": "git",
                 "url": "ssh://git@infra.flowdat.com:222/VendorSoftwareFlowdat3/Webservice.git",
-                "reference": "657599a288990dc1c2505567376bb12c522d1750"
+                "reference": "dc5bad4b0b90885bd49b17472aa24267e3d4f15d"
             },
             "require": {
                 "ext-curl": "*",
@@ -1460,7 +1460,7 @@
                 }
             },
             "description": "The Flowdat3 Webservice Rest",
-            "time": "2017-08-01 17:54:58"
+            "time": "2017-08-09 12:58:39"
         },
         {
             "name": "incenteev/composer-parameter-handler",

+ 3 - 3
src/StatsBundle/Admin/OnuAdmin.php

@@ -46,9 +46,9 @@ class OnuAdmin extends BaseAdmin
             ->add('temperature', 'string', array('template' => 'StatsBundle:Onu:base_list_field_temperature.html.twig'))
             ->add('uptime', 'string', array('template' => 'StatsBundle:Onu:base_list_field_uptime.html.twig'))
             ->add('updated')
-            ->add('_action', null, array(
-                'actions' => array('show' => array())
-                ))
+            //->add('_action', null, array(
+            //    'actions' => array('show' => array())
+            //    ))
         ;
     }
 

+ 35 - 0
src/StatsBundle/Entity/DeviceServer.php

@@ -55,6 +55,11 @@ class DeviceServer
      */
     private $deviceTypes;
 
+    /**
+     * @ORM\OneToMany(targetEntity="Device", mappedBy="deviceServer", fetch="EXTRA_LAZY")
+     */
+    protected $devices;
+
 
     /**
      * @return string
@@ -132,4 +137,34 @@ class DeviceServer
         return $this;
     }
 
+    /**
+     * @param Device $device
+     * @return DeviceServer
+     */
+    public function addDevice(Device $device)
+    {
+        $this->devices[] = $device;
+
+        return $this;
+    }
+
+    /**
+     * @param Device $device
+     * @return DeviceServer
+     */
+    public function removeDevice(Device $device)
+    {
+        $this->devices->removeElement($device);
+
+        return $this;
+    }
+
+    /**
+     * @return Doctrine\Common\Collections\Collection 
+     */
+    public function getDevices()
+    {
+        return $this->devices;
+    }
+
 }