Pārlūkot izejas kodu

FD3-222 se quitaron algunos use. Formateo entidades

Guillermo Espinoza 7 gadi atpakaļ
vecāks
revīzija
6b6a686ef0
2 mainītis faili ar 34 papildinājumiem un 39 dzēšanām
  1. 20 22
      src/StatsBundle/Entity/Onu.php
  2. 14 17
      src/StatsBundle/Entity/PonPort.php

+ 20 - 22
src/StatsBundle/Entity/Onu.php

@@ -3,11 +3,8 @@
 namespace StatsBundle\Entity;
 
 use Doctrine\ORM\Mapping as ORM;
-use ExtraDataBundle\Entity\Traits\ExtraDataTrait;
 use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
 use Symfony\Component\Validator\Constraints as Assert;
-use Symfony\Component\Workflow\Exception\ExceptionInterface;
-
 
 /**
  * @ORM\Table
@@ -34,9 +31,9 @@ class Onu
      * @ORM\Column(type="integer", nullable=true)
      * 
      */
-     private $oltDeviceId;
-     
-     /**
+    private $oltDeviceId;
+
+    /**
      * @ORM\Id
      * @ORM\ManyToOne(targetEntity="DeviceServer", inversedBy="devices", fetch="EXTRA_LAZY")
      * 
@@ -49,15 +46,15 @@ class Onu
      * @ORM\Column(type="integer", nullable=true)
      * 
      */
-     private $deviceId;
-    
+    private $deviceId;
+
     /**
      * @var int
      *
      * @ORM\Column(type="integer", nullable=false, options={"default":1})
      */
     protected $tenancyId = 1;
-    
+
     /**
      * @var string
      *
@@ -66,21 +63,21 @@ class Onu
      * @Assert\Ip
      */
     private $ip;
-    
+
     /**
      * @var string
      *
      * @ORM\Column(type="string", length=12, nullable=true)
      */
     private $mac;
-    
+
     /**
      * @var string
      *
      * @ORM\Column(type="string", length=25, nullable=true)
      */
     private $serialNumber;
-    
+
     /**
      * @ORM\Column(type="string", length=25, nullable=true)
      */
@@ -90,22 +87,22 @@ class Onu
      * @ORM\Column(name="status", type="boolean", nullable=true, columnDefinition="BOOLEAN DEFAULT FALSE")
      */
     public $status = false;
-    
+
     /**
      * @ORM\Column(type="decimal", precision=6, scale=3, nullable=true)
      */
     public $txPower;
-    
+
     /**
      * @ORM\Column(type="decimal", precision=6, scale=3, nullable=true)
      */
     public $rxPower;
-    
+
     /**
      * @ORM\Column(type="decimal", precision=6, scale=3, nullable=true)
      */
     public $voltage;
-    
+
     /**
      * @ORM\Column(type="decimal", precision=6, scale=3, nullable=true)
      */
@@ -120,11 +117,12 @@ class Onu
      * @ORM\Column(type="datetime")
      */
     protected $updated;
-    
+
+
     /**
      * @return string
      */
-    public function getId() 
+    public function getId()
     {
         return sprintf('%s~%s~%s', strtolower($this->ponSerialNumber), $this->oltDeviceId, $this->deviceServer->getId());
     }
@@ -229,7 +227,7 @@ class Onu
         return strtoupper($this->ponSerialNumber);
     }
 
-     /**
+    /**
      * Set ponPort
      *
      * @param string $ponPort
@@ -272,7 +270,7 @@ class Onu
     {
         return $this->deviceId;
     }
-    
+
     /**
      * @param int $oltDeviceId
      *
@@ -313,9 +311,9 @@ class Onu
         return $this;
     }
 
-    public function getShortType() 
+    public function getShortType()
     {
-        return str_replace("FTTHBundle\\Entity\\","",$this->deviceType);
+        return str_replace("FTTHBundle\\Entity\\", "", $this->deviceType);
     }
 
     /**

+ 14 - 17
src/StatsBundle/Entity/PonPort.php

@@ -3,11 +3,7 @@
 namespace StatsBundle\Entity;
 
 use Doctrine\ORM\Mapping as ORM;
-use ExtraDataBundle\Entity\Traits\ExtraDataTrait;
 use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
-use Symfony\Component\Validator\Constraints as Assert;
-use Symfony\Component\Workflow\Exception\ExceptionInterface;
-
 
 /**
  * @ORM\Table
@@ -26,7 +22,7 @@ class PonPort
      * @ORM\Id
      * @ORM\GeneratedValue(strategy="AUTO")
      */
-     private $id;
+    private $id;
 
     /**
      * @var string
@@ -42,7 +38,7 @@ class PonPort
      * 
      */
     private $oltDeviceId;
-     
+
     /**
      * @ORM\ManyToOne(targetEntity="DeviceServer", inversedBy="devices", fetch="EXTRA_LAZY")
      * 
@@ -55,7 +51,7 @@ class PonPort
      * @ORM\Column(type="integer", nullable=false, options={"default":1})
      */
     protected $tenancyId = 1;
-    
+
     /**
      * @ORM\Column(type="datetime")
      */
@@ -65,27 +61,28 @@ class PonPort
      * @ORM\Column(type="decimal", precision=6, scale=3, nullable=true)
      */
     public $txPower;
-     
+
     /**
      * @ORM\Column(type="text", nullable=true)
      */
     public $rxPower;
-     
+
     /**
      * @ORM\Column(type="decimal", precision=6, scale=3, nullable=true)
      */
     public $voltage;
-     
+
     /**
      * @ORM\Column(type="decimal", precision=6, scale=3, nullable=true)
      */
     public $temperature;
-    
+
     /**
      * @ORM\Column(type="decimal", precision=6, scale=3, nullable=true)
      */
     public $biasCurrent;
 
+
     /**
      * @return int
      */
@@ -225,7 +222,7 @@ class PonPort
         $this->txPower = $txPower;
         return $this;
     }
- 
+
     /**
      * Get txPower
      *
@@ -235,7 +232,7 @@ class PonPort
     {
         return $this->txPower;
     }
- 
+
     /**
      * Set rxPower
      *
@@ -265,13 +262,13 @@ class PonPort
      */
     public function getArrayRxPower()
     {
-        if($this->rxPower) {
+        if ($this->rxPower) {
             return json_decode($this->rxPower, true);
         }
 
         return array();
     }
- 
+
     /**
      * Set voltage
      *
@@ -293,7 +290,7 @@ class PonPort
     {
         return $this->voltage;
     }
- 
+
     /**
      * Set temperature
      *
@@ -315,7 +312,7 @@ class PonPort
     {
         return $this->temperature;
     }
-    
+
     /**
      * Set biasCurrent
      *