Forráskód Böngészése

Migración para la acción de Cablemodem y se acomoda la indexación de los voips, para que siempre inicien desde 0 en el array.

Maxi Schvindt 7 éve
szülő
commit
b2d53da772

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 1
app/DoctrineMigrations/Version20180124153518.yml


+ 12 - 1
src/CablemodemBundle/Entity/Cablemodem.php

@@ -414,9 +414,20 @@ class Cablemodem implements DeviceInterface, TenancyIdTraitInterface, LocationIn
      */
     public function setVoip($voip)
     {
-        $this->voip = $voip;
+        if(is_null($voip)) {
+            $this->voip = $voip;
+            return $this;
+        }
 
+        $this->voip = array_values($voip);
         return $this;
     }
 
+    public function getVoipData($index)
+    {
+        if(is_null($this->voip)) return null;
+
+        if(isset($this->voip[$index])) return $this->voip[$index];
+    }
+
 }