|
@@ -0,0 +1,341 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+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
|
|
|
+ * @ORM\Entity
|
|
|
+ * @UniqueEntity(fields={"deviceServer", "oltDeviceId", "ponPort"}, message="errors.duplicate_key")
|
|
|
+ * @ORM\Table(uniqueConstraints={@ORM\UniqueConstraint(name="unique_idx", columns={"device_server_id", "olt_device_id", "pon_port"})})
|
|
|
+ *
|
|
|
+ */
|
|
|
+class PonPort
|
|
|
+{
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var int
|
|
|
+ *
|
|
|
+ * @ORM\Column(name="id", type="integer")
|
|
|
+ * @ORM\Id
|
|
|
+ * @ORM\GeneratedValue(strategy="AUTO")
|
|
|
+ */
|
|
|
+ private $id;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var string
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="string", length=25, nullable=true)
|
|
|
+ */
|
|
|
+ private $ponPort;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var int
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="integer", nullable=true)
|
|
|
+ *
|
|
|
+ */
|
|
|
+ private $oltDeviceId;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\ManyToOne(targetEntity="DeviceServer", inversedBy="devices", fetch="EXTRA_LAZY")
|
|
|
+ *
|
|
|
+ */
|
|
|
+ protected $deviceServer;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var int
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="integer", nullable=false, options={"default":1})
|
|
|
+ */
|
|
|
+ protected $tenancyId = 1;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Column(type="datetime")
|
|
|
+ */
|
|
|
+ protected $updated;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @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
|
|
|
+ */
|
|
|
+ public function getId()
|
|
|
+ {
|
|
|
+ return $this->id;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function __toString()
|
|
|
+ {
|
|
|
+ return sprintf('%s', strtoupper($this->ponPort));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set ponPort
|
|
|
+ *
|
|
|
+ * @param string $ponPort
|
|
|
+ *
|
|
|
+ * @return PonPort
|
|
|
+ */
|
|
|
+ public function setPonPort($ponPort)
|
|
|
+ {
|
|
|
+ $this->ponPort = $ponPort;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get ponPort
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getPonPort()
|
|
|
+ {
|
|
|
+ return $this->ponPort;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param int $oltDeviceId
|
|
|
+ *
|
|
|
+ * @return PonPort
|
|
|
+ */
|
|
|
+ public function setOltDeviceId($oltDeviceId)
|
|
|
+ {
|
|
|
+ $this->oltDeviceId = $oltDeviceId;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return int
|
|
|
+ */
|
|
|
+ public function getOltDeviceId()
|
|
|
+ {
|
|
|
+ return $this->oltDeviceId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param DeviceServer $deviceServer
|
|
|
+ *
|
|
|
+ * @return PonPort
|
|
|
+ */
|
|
|
+ public function setDeviceServer($deviceServer)
|
|
|
+ {
|
|
|
+ $this->deviceServer = $deviceServer;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return DeviceServer
|
|
|
+ */
|
|
|
+ public function getDeviceServer()
|
|
|
+ {
|
|
|
+ return $this->deviceServer;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set tenancyId
|
|
|
+ *
|
|
|
+ * @param int $tenancyId
|
|
|
+ *
|
|
|
+ * @return PonPort
|
|
|
+ */
|
|
|
+ public function setTenancyId($tenancyId)
|
|
|
+ {
|
|
|
+ $this->tenancyId = $tenancyId;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get tenancyId
|
|
|
+ *
|
|
|
+ * @return int
|
|
|
+ */
|
|
|
+ public function getTenancyId()
|
|
|
+ {
|
|
|
+ return $this->tenancyId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set updated
|
|
|
+ *
|
|
|
+ * @param Datetime $tenancyId
|
|
|
+ *
|
|
|
+ * @return PonPort
|
|
|
+ */
|
|
|
+ public function setUpdated($updated)
|
|
|
+ {
|
|
|
+ $this->updated = $updated;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get updated
|
|
|
+ *
|
|
|
+ * @return \DateTime
|
|
|
+ */
|
|
|
+ public function getUpdated()
|
|
|
+ {
|
|
|
+ return $this->updated;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set txPower
|
|
|
+ *
|
|
|
+ * @param decimal $txPower
|
|
|
+ * @return PonPort
|
|
|
+ */
|
|
|
+ public function setTxPower($txPower)
|
|
|
+ {
|
|
|
+ $this->txPower = $txPower;
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get txPower
|
|
|
+ *
|
|
|
+ * @return decimal
|
|
|
+ */
|
|
|
+ public function getTxPower()
|
|
|
+ {
|
|
|
+ return $this->txPower;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set rxPower
|
|
|
+ *
|
|
|
+ * @param string $rxPower
|
|
|
+ * @return PonPort
|
|
|
+ */
|
|
|
+ public function setRxPower($rxPower)
|
|
|
+ {
|
|
|
+ $this->rxPower = $rxPower;
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get rxPower
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getRxPower()
|
|
|
+ {
|
|
|
+ return $this->rxPower;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get rxPower
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getArrayRxPower()
|
|
|
+ {
|
|
|
+ if($this->rxPower) {
|
|
|
+ return json_decode($this->rxPower, true);
|
|
|
+ }
|
|
|
+
|
|
|
+ return array();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set voltage
|
|
|
+ *
|
|
|
+ * @param decimal $voltage
|
|
|
+ * @return PonPort
|
|
|
+ */
|
|
|
+ public function setVoltage($voltage)
|
|
|
+ {
|
|
|
+ $this->voltage = $voltage;
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get voltage
|
|
|
+ *
|
|
|
+ * @return decimal
|
|
|
+ */
|
|
|
+ public function getVoltage()
|
|
|
+ {
|
|
|
+ return $this->voltage;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set temperature
|
|
|
+ *
|
|
|
+ * @param decimal $temperature
|
|
|
+ * @return PonPort
|
|
|
+ */
|
|
|
+ public function setTemperature($temperature)
|
|
|
+ {
|
|
|
+ $this->temperature = $temperature;
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get temperature
|
|
|
+ *
|
|
|
+ * @return decimal
|
|
|
+ */
|
|
|
+ public function getTemperature()
|
|
|
+ {
|
|
|
+ return $this->temperature;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set biasCurrent
|
|
|
+ *
|
|
|
+ * @param decimal $biasCurrent
|
|
|
+ * @return PonPort
|
|
|
+ */
|
|
|
+ public function setBiasCurrent($biasCurrent)
|
|
|
+ {
|
|
|
+ $this->biasCurrent = $biasCurrent;
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get biasCurrent
|
|
|
+ *
|
|
|
+ * @return decimal
|
|
|
+ */
|
|
|
+ public function getBiasCurrent()
|
|
|
+ {
|
|
|
+ return $this->biasCurrent;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|