src/Entity/Api/KelSyncDevice.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Api;
  3. use Gedmo\Mapping\Annotation as Gedmo;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use App\Helper\Parsedown;
  8. /**
  9.  * @ORM\Table(name="app_api_kelsync_device")
  10.  * @ORM\Entity()
  11.  */
  12. class KelSyncDevice
  13. {
  14.     /**
  15.      * @var int
  16.      *
  17.      * @ORM\Column(name="id", type="bigint")
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="AUTO")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @ORM\Column(type="string", length=400, nullable=true)
  24.      */
  25.     private $ip;
  26.     /**
  27.      * @ORM\Column(type="string", length=400)
  28.      */
  29.     private $name;
  30.     /**
  31.      * @ORM\Column(type="string", length=400)
  32.      */
  33.     private $deviceId;
  34.     /**
  35.      * @ORM\Column(type="datetime", nullable=true)
  36.      */
  37.     private $addDate;
  38.     /**
  39.      * @ORM\Column(type="datetime", nullable=true)
  40.      */
  41.     private $updateDate;
  42.     /**
  43.      * @ORM\OneToMany(targetEntity="KelSyncLinkItem", mappedBy="device", cascade={"persist", "remove"})
  44.      */
  45.     private $linkItems;
  46.     public function __construct()
  47.     {
  48.         $this->linkItems = new ArrayCollection();
  49.     }
  50.     /**
  51.      * Get id
  52.      *
  53.      * @return int
  54.      */
  55.     public function getId()
  56.     {
  57.         return $this->id;
  58.     }
  59.     /**
  60.      * @return mixed
  61.      */
  62.     public function getName()
  63.     {
  64.         return $this->name;
  65.     }
  66.     /**
  67.      * @param mixed $name
  68.      */
  69.     public function setName($name): void
  70.     {
  71.         $this->name $name;
  72.     }
  73.     /**
  74.      * @return mixed
  75.      */
  76.     public function getDeviceId()
  77.     {
  78.         return $this->deviceId;
  79.     }
  80.     /**
  81.      * @param mixed $deviceId
  82.      */
  83.     public function setDeviceId($deviceId): void
  84.     {
  85.         $this->deviceId $deviceId;
  86.     }
  87.     /**
  88.      * @return mixed
  89.      */
  90.     public function getAddDate()
  91.     {
  92.         return $this->addDate;
  93.     }
  94.     /**
  95.      * @param mixed $addDate
  96.      */
  97.     public function setAddDate($addDate): void
  98.     {
  99.         $this->addDate $addDate;
  100.     }
  101.     /**
  102.      * @return mixed
  103.      */
  104.     public function getUpdateDate()
  105.     {
  106.         return $this->updateDate;
  107.     }
  108.     /**
  109.      * @param mixed $updateDate
  110.      */
  111.     public function setUpdateDate($updateDate): void
  112.     {
  113.         $this->updateDate $updateDate;
  114.     }
  115.     /**
  116.      * @return Collection|KelSyncLinkItem[]
  117.      */
  118.     public function getLinkItems(): Collection
  119.     {
  120.         return $this->linkItems;
  121.     }
  122.     /**
  123.      * @param KelSyncLinkItem $linkItem
  124.      */
  125.     public function addLinkItem(KelSyncLinkItem $linkItem): void
  126.     {
  127.         if (!$this->linkItems->contains($linkItem)) {
  128.             $this->linkItems[] = $linkItem;
  129.             $linkItem->setDevice($this);
  130.         }
  131.     }
  132.     /**
  133.      * @param KelSyncLinkItem $linkItem
  134.      */
  135.     public function removeLinkItem(KelSyncLinkItem $linkItem): void
  136.     {
  137.         if ($this->linkItems->contains($linkItem)) {
  138.             $this->linkItems->removeElement($linkItem);
  139.             if ($linkItem->getDevice() === $this) {
  140.                 $linkItem->setDevice(null);
  141.             }
  142.         }
  143.     }
  144.     /**
  145.      * @return mixed
  146.      */
  147.     public function getIp()
  148.     {
  149.         return $this->ip;
  150.     }
  151.     /**
  152.      * @param mixed $ip
  153.      */
  154.     public function setIp($ip): void
  155.     {
  156.         $this->ip $ip;
  157.     }
  158. }