소스 검색

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 년 전
부모
커밋
b2d53da772
2개의 변경된 파일13개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      app/DoctrineMigrations/Version20180124153518.yml
  2. 12 1
      src/CablemodemBundle/Entity/Cablemodem.php

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 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];
+    }
+
 }