|
@@ -0,0 +1,227 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace StatsBundle\Entity;
|
|
|
+
|
|
|
+use Doctrine\ORM\Mapping as ORM;
|
|
|
+use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|
|
+use Symfony\Component\Validator\Constraints as Assert;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @ORM\Table
|
|
|
+ * @ORM\Entity
|
|
|
+ */
|
|
|
+class DeviceConsumption
|
|
|
+{
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Id
|
|
|
+ * @ORM\ManyToOne(targetEntity="DeviceServer", fetch="EXTRA_LAZY")
|
|
|
+ */
|
|
|
+ protected $server;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Id
|
|
|
+ * @var int
|
|
|
+ *
|
|
|
+ * @ORM\Column(name="father_device_id", type="integer", nullable=false, options={"comment":"id(CMTS/OLT/NAS)"})
|
|
|
+ */
|
|
|
+ private $fatherDevice;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Id
|
|
|
+ * @var int
|
|
|
+ *
|
|
|
+ * @ORM\Column(name="father_device_type", type="integer", nullable=false, options={"comment":"(CMTS = 1/OLT = 2/NAS = 3)"})
|
|
|
+ */
|
|
|
+ private $fatherDeviceType;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Id
|
|
|
+ * @ORM\Column(type="string", length=50, nullable=false, options={"comment":"mac/serialNumber/ponSerialNumber"})
|
|
|
+ */
|
|
|
+ private $device;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Id
|
|
|
+ * @ORM\Column(type="string", length=10, nullable=false, options={"comment":"YYYY-MM-DD"})
|
|
|
+ */
|
|
|
+ private $date;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Column(name="cons_in", type="decimal", precision=15, scale=5, nullable=false, options={"comment":"GigaBytes"})
|
|
|
+ */
|
|
|
+ protected $in;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\Column(name="cons_out", type="decimal", precision=15, scale=5, nullable=false, options={"comment":"GigaBytes"})
|
|
|
+ */
|
|
|
+ protected $out;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set fatherDevice
|
|
|
+ *
|
|
|
+ * @param integer $fatherDevice
|
|
|
+ *
|
|
|
+ * @return DeviceConsumption
|
|
|
+ */
|
|
|
+ public function setFatherDevice($fatherDevice)
|
|
|
+ {
|
|
|
+ $this->fatherDevice = $fatherDevice;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get fatherDevice
|
|
|
+ *
|
|
|
+ * @return integer
|
|
|
+ */
|
|
|
+ public function getFatherDevice()
|
|
|
+ {
|
|
|
+ return $this->fatherDevice;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set fatherDeviceType
|
|
|
+ *
|
|
|
+ * @param integer $fatherDeviceType
|
|
|
+ *
|
|
|
+ * @return DeviceConsumption
|
|
|
+ */
|
|
|
+ public function setFatherDeviceType($fatherDeviceType)
|
|
|
+ {
|
|
|
+ $this->fatherDeviceType = $fatherDeviceType;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get fatherDeviceType
|
|
|
+ *
|
|
|
+ * @return integer
|
|
|
+ */
|
|
|
+ public function getFatherDeviceType()
|
|
|
+ {
|
|
|
+ return $this->fatherDeviceType;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set device
|
|
|
+ *
|
|
|
+ * @param string $device
|
|
|
+ *
|
|
|
+ * @return DeviceConsumption
|
|
|
+ */
|
|
|
+ public function setDevice($device)
|
|
|
+ {
|
|
|
+ $this->device = $device;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get device
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getDevice()
|
|
|
+ {
|
|
|
+ return $this->device;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set date
|
|
|
+ *
|
|
|
+ * @param string $date
|
|
|
+ *
|
|
|
+ * @return DeviceConsumption
|
|
|
+ */
|
|
|
+ public function setDate($date)
|
|
|
+ {
|
|
|
+ $this->date = $date;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get date
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getDate()
|
|
|
+ {
|
|
|
+ return $this->date;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set in
|
|
|
+ *
|
|
|
+ * @param string $in
|
|
|
+ *
|
|
|
+ * @return DeviceConsumption
|
|
|
+ */
|
|
|
+ public function setIn($in)
|
|
|
+ {
|
|
|
+ $this->in = $in;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get in
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getIn()
|
|
|
+ {
|
|
|
+ return $this->in;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set out
|
|
|
+ *
|
|
|
+ * @param string $out
|
|
|
+ *
|
|
|
+ * @return DeviceConsumption
|
|
|
+ */
|
|
|
+ public function setOut($out)
|
|
|
+ {
|
|
|
+ $this->out = $out;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get out
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getOut()
|
|
|
+ {
|
|
|
+ return $this->out;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set server
|
|
|
+ *
|
|
|
+ * @param \StatsBundle\Entity\DeviceServer $server
|
|
|
+ *
|
|
|
+ * @return DeviceConsumption
|
|
|
+ */
|
|
|
+ public function setServer(\StatsBundle\Entity\DeviceServer $server = null)
|
|
|
+ {
|
|
|
+ $this->server = $server;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get server
|
|
|
+ *
|
|
|
+ * @return \StatsBundle\Entity\DeviceServer
|
|
|
+ */
|
|
|
+ public function getServer()
|
|
|
+ {
|
|
|
+ return $this->server;
|
|
|
+ }
|
|
|
+}
|