|
@@ -0,0 +1,186 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace StatsBundle\Entity;
|
|
|
+
|
|
|
+use Doctrine\ORM\Mapping as ORM;
|
|
|
+use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|
|
+use Symfony\Component\Validator\Constraints as Assert;
|
|
|
+use Gedmo\Mapping\Annotation as Gedmo;
|
|
|
+use JMS\Serializer\Annotation as JMS;
|
|
|
+use Base\AdminBundle\Traits\TenancyIdTrait;
|
|
|
+use Base\AdminBundle\Traits\TenancyIdTraitInterface;
|
|
|
+use ExtraDataBundle\Entity\Traits\ExtraDataTrait;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * @ORM\Table
|
|
|
+ * @ORM\Entity
|
|
|
+ */
|
|
|
+class Report implements TenancyIdTraitInterface
|
|
|
+{
|
|
|
+ use ExtraDataTrait;
|
|
|
+ use TenancyIdTrait;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var int
|
|
|
+ *
|
|
|
+ * @ORM\Column(name="id", type="integer", nullable=false)
|
|
|
+ * @ORM\Id
|
|
|
+ * @ORM\GeneratedValue(strategy="AUTO")
|
|
|
+ */
|
|
|
+ private $id;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var string
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="string", length=255, nullable=true)
|
|
|
+ *
|
|
|
+ */
|
|
|
+ private $deviceType;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var string
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="string", length=255, nullable=true)
|
|
|
+ *
|
|
|
+ */
|
|
|
+ private $reportType;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @var int
|
|
|
+ *
|
|
|
+ * @ORM\Column(type="integer", nullable=true)
|
|
|
+ */
|
|
|
+ private $deviceId;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\ManyToOne(targetEntity="DeviceServer", inversedBy="devices", fetch="EXTRA_LAZY")
|
|
|
+ *
|
|
|
+ * @JMS\MaxDepth(1)
|
|
|
+ */
|
|
|
+ protected $deviceServer;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Gedmo\Timestampable(on="create")
|
|
|
+ * @ORM\Column(type="datetime")
|
|
|
+ */
|
|
|
+ protected $created;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function __toString()
|
|
|
+ {
|
|
|
+ return sprintf('%s %s', strtoupper($this->reportType), strtoupper($this->deviceType));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return int
|
|
|
+ */
|
|
|
+ public function getId()
|
|
|
+ {
|
|
|
+ return $this->id;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set deviceType
|
|
|
+ *
|
|
|
+ * @param string $deviceType
|
|
|
+ *
|
|
|
+ * @return Report
|
|
|
+ */
|
|
|
+ public function setDeviceType($deviceType)
|
|
|
+ {
|
|
|
+ $this->deviceType = $deviceType;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get deviceType
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getDeviceType()
|
|
|
+ {
|
|
|
+ return $this->deviceType;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set reportType
|
|
|
+ *
|
|
|
+ * @param string $reportType
|
|
|
+ *
|
|
|
+ * @return Report
|
|
|
+ */
|
|
|
+ public function setReportType($reportType)
|
|
|
+ {
|
|
|
+ $this->reportType = $reportType;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get reportType
|
|
|
+ *
|
|
|
+ * @return string
|
|
|
+ */
|
|
|
+ public function getReportType()
|
|
|
+ {
|
|
|
+ return $this->reportType;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param int $deviceId
|
|
|
+ *
|
|
|
+ * @return Report
|
|
|
+ */
|
|
|
+ public function setDeviceId($deviceId)
|
|
|
+ {
|
|
|
+ $this->deviceId = $deviceId;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return int
|
|
|
+ */
|
|
|
+ public function getDeviceId()
|
|
|
+ {
|
|
|
+ return $this->deviceId;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param DeviceServer $deviceServer
|
|
|
+ *
|
|
|
+ * @return Report
|
|
|
+ */
|
|
|
+ public function setDeviceServer($deviceServer)
|
|
|
+ {
|
|
|
+ $this->deviceServer = $deviceServer;
|
|
|
+
|
|
|
+ return $this;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @return DeviceServer
|
|
|
+ */
|
|
|
+ public function getDeviceServer()
|
|
|
+ {
|
|
|
+ return $this->deviceServer;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Get updated
|
|
|
+ *
|
|
|
+ * @return \DateTime
|
|
|
+ */
|
|
|
+ public function getCreated()
|
|
|
+ {
|
|
|
+ return $this->created;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|