|
@@ -0,0 +1,482 @@
|
|
|
+<?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;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @ORM\Table
|
|
|
+ * @ORM\Entity
|
|
|
+ *
|
|
|
+ */
|
|
|
+class Onu
|
|
|
+{
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var int
|
|
|
+ *
|
|
|
+ * @ORM\Column(name="id", type="integer", nullable=false)
|
|
|
+ * @ORM\Id
|
|
|
+ * @ORM\GeneratedValue(strategy="AUTO")
|
|
|
+ */
|
|
|
+ private $id;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var int
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="integer", nullable=true)
|
|
|
+ *
|
|
|
+ */
|
|
|
+ private $deviceId;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @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;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var string
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="string", length=255, nullable=true)
|
|
|
+ *
|
|
|
+ * @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;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var string
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="string", length=25, nullable=true)
|
|
|
+ */
|
|
|
+ private $ponSerialNumber;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Column(type="string", length=25, nullable=true)
|
|
|
+ */
|
|
|
+ private $ponPort;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @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)
|
|
|
+ */
|
|
|
+ public $temperature;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Column(type="string", length=25, nullable=true)
|
|
|
+ */
|
|
|
+ public $uptime;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Column(type="datetime")
|
|
|
+ */
|
|
|
+ protected $updated;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function __toString()
|
|
|
+ {
|
|
|
+ return sprintf('%s %s', $this->deviceType, $this->ip);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getId()
|
|
|
+ {
|
|
|
+ return $this->id;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string $ip
|
|
|
+ *
|
|
|
+ * @return Device
|
|
|
+ */
|
|
|
+ public function setIp($ip = null)
|
|
|
+ {
|
|
|
+ $this->ip = $ip;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getIp()
|
|
|
+ {
|
|
|
+ return $this->ip;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set mac
|
|
|
+ *
|
|
|
+ * @param string $mac
|
|
|
+ *
|
|
|
+ * @return ONU
|
|
|
+ */
|
|
|
+ public function setMac($mac)
|
|
|
+ {
|
|
|
+ $this->mac = $mac;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get mac
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getMac()
|
|
|
+ {
|
|
|
+ return $this->mac;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set serialNumber
|
|
|
+ *
|
|
|
+ * @param string $serialNumber
|
|
|
+ *
|
|
|
+ * @return ONU
|
|
|
+ */
|
|
|
+ public function setSerialNumber($serialNumber)
|
|
|
+ {
|
|
|
+ $this->serialNumber = $serialNumber;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get serialNumber
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getSerialNumber()
|
|
|
+ {
|
|
|
+ return $this->serialNumber;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set ponSerialNumber
|
|
|
+ *
|
|
|
+ * @param string $ponSerialNumber
|
|
|
+ *
|
|
|
+ * @return ONU
|
|
|
+ */
|
|
|
+ public function setPonSerialNumber($ponSerialNumber)
|
|
|
+ {
|
|
|
+ $this->ponSerialNumber = $ponSerialNumber;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get ponSerialNumber
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getPonSerialNumber()
|
|
|
+ {
|
|
|
+ return $this->ponSerialNumber;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set ponPort
|
|
|
+ *
|
|
|
+ * @param string $ponPort
|
|
|
+ *
|
|
|
+ * @return ONU
|
|
|
+ */
|
|
|
+ public function setPonPort($ponPort)
|
|
|
+ {
|
|
|
+ $this->ponPort = $ponPort;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get ponPort
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getPonPort()
|
|
|
+ {
|
|
|
+ return $this->ponPort;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param int $deviceId
|
|
|
+ *
|
|
|
+ * @return ONU
|
|
|
+ */
|
|
|
+ public function setDeviceId($deviceId)
|
|
|
+ {
|
|
|
+ $this->deviceId = $deviceId;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return int
|
|
|
+ */
|
|
|
+ public function getDeviceId()
|
|
|
+ {
|
|
|
+ return $this->deviceId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param int $oltDeviceId
|
|
|
+ *
|
|
|
+ * @return ONU
|
|
|
+ */
|
|
|
+ public function setOltDeviceId($oltDeviceId)
|
|
|
+ {
|
|
|
+ $this->oltDeviceId = $oltDeviceId;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return int
|
|
|
+ */
|
|
|
+ public function getOltDeviceId()
|
|
|
+ {
|
|
|
+ return $this->oltDeviceId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return DeviceServer
|
|
|
+ */
|
|
|
+ public function getDeviceServer()
|
|
|
+ {
|
|
|
+ return $this->deviceServer;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param DeviceServer $deviceServer
|
|
|
+ *
|
|
|
+ * @return ONU
|
|
|
+ */
|
|
|
+ public function setDeviceServer($deviceServer)
|
|
|
+ {
|
|
|
+ $this->deviceServer = $deviceServer;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getShortType()
|
|
|
+ {
|
|
|
+ return str_replace("FTTHBundle\\Entity\\","",$this->deviceType);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set tenancyId
|
|
|
+ *
|
|
|
+ * @param int $tenancyId
|
|
|
+ *
|
|
|
+ * @return ONU
|
|
|
+ */
|
|
|
+ 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 ONU
|
|
|
+ */
|
|
|
+ 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 ONU
|
|
|
+ */
|
|
|
+ public function setTxPower($txPower)
|
|
|
+ {
|
|
|
+ $this->txPower = $txPower;
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get txPower
|
|
|
+ *
|
|
|
+ * @return decimal
|
|
|
+ */
|
|
|
+ public function getTxPower()
|
|
|
+ {
|
|
|
+ return $this->txPower;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set rxPower
|
|
|
+ *
|
|
|
+ * @param decimal $rxPower
|
|
|
+ * @return ONU
|
|
|
+ */
|
|
|
+ public function setRxPower($rxPower)
|
|
|
+ {
|
|
|
+ $this->rxPower = $rxPower;
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get rxPower
|
|
|
+ *
|
|
|
+ * @return decimal
|
|
|
+ */
|
|
|
+ public function getRxPower()
|
|
|
+ {
|
|
|
+ return $this->rxPower;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set voltage
|
|
|
+ *
|
|
|
+ * @param decimal $voltage
|
|
|
+ * @return ONU
|
|
|
+ */
|
|
|
+ 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 ONU
|
|
|
+ */
|
|
|
+ public function setTemperature($temperature)
|
|
|
+ {
|
|
|
+ $this->temperature = $temperature;
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get temperature
|
|
|
+ *
|
|
|
+ * @return decimal
|
|
|
+ */
|
|
|
+ public function getTemperature()
|
|
|
+ {
|
|
|
+ return $this->temperature;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set uptime
|
|
|
+ *
|
|
|
+ * @param string $uptime
|
|
|
+ * @return ONU
|
|
|
+ */
|
|
|
+ public function setUptime($uptime)
|
|
|
+ {
|
|
|
+ $this->uptime = $uptime;
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get uptime
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getUptime()
|
|
|
+ {
|
|
|
+ return $this->uptime;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|