src/Entity/WinWOP/SmcRequest.php line 21

Open in your IDE?
  1. <?php
  2. /**
  3.  * Copyright (c) 2019, MND Next GmbH - www.mndnext.de
  4.  */
  5. namespace App\Entity\WinWOP;
  6. use App\Entity\Machine;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Component\HttpFoundation\File\File;
  10. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. /**
  13.  * @ORM\Entity
  14.  * @ORM\HasLifecycleCallbacks()
  15.  * @ORM\Table(name="win_wop_smc_requests")
  16.  * @Vich\Uploadable
  17.  */
  18. class SmcRequest
  19. {
  20.     /**
  21.      * @ORM\Id
  22.      * @ORM\Column(type="integer")
  23.      * @ORM\GeneratedValue(strategy="AUTO")
  24.      */
  25.     protected $id;
  26.     /**
  27.      * @ORM\OneToOne(targetEntity="App\Entity\Machine", inversedBy="smc_request", cascade={"persist"})
  28.      */
  29.     private $machine;
  30.     /**
  31.      * @var \DateTime
  32.      *
  33.      * @ORM\Column(name="created", type="datetime", nullable=false)
  34.      */
  35.     private $created;
  36.     /**
  37.      * @var string
  38.      *
  39.      * @ORM\Column(name="comment")
  40.      */
  41.     private $comment;
  42.     /**
  43.      * Constructor
  44.      */
  45.     public function __construct()
  46.     {
  47.         $this->created = new \DateTime();
  48.     }
  49.     public function getId()
  50.     {
  51.         return $this->id;
  52.     }
  53.     public function setCreated($created)
  54.     {
  55.         $this->created $created;
  56.         return $this;
  57.     }
  58.     public function getCreated()
  59.     {
  60.         return $this->created;
  61.     }
  62.     public function setMachine(Machine $machine null)
  63.     {
  64.         $this->machine $machine;
  65.         return $this;
  66.     }
  67.     public function getMachine() : ?Machine
  68.     {
  69.         return $this->machine;
  70.     }
  71.     public function setComment($comment)
  72.     {
  73.         $this->comment $comment;
  74.         return $this;
  75.     }
  76.     public function getComment()
  77.     {
  78.         return $this->comment;
  79.     }
  80.     public function __toString()
  81.     {
  82.         return $this->getMachine()->getSerial();
  83.     }
  84. }