src/Entity/Gos/Uniqskills/UserTestDraft.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos\Uniqskills;
  3. use App\Entity\Gos\User;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Gedmo\Mapping\Annotation as Gedmo;
  6. /**
  7.  * @ORM\Table()
  8.  * @ORM\Entity(repositoryClass="App\Repository\Gos\Uniqskills\UserTestDraftRepository")
  9.  * @ORM\HasLifecycleCallbacks
  10.  */
  11. class UserTestDraft
  12. {
  13.     /**
  14.      * @var integer
  15.      *
  16.      * @ORM\Column(type="integer")
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\Column(type="string")
  23.      */
  24.     private $draft;
  25.     /**
  26.      * @var \DateTime
  27.      *
  28.      * @ORM\Column(type="datetime", nullable=true)
  29.      */
  30.     private $createdAt;
  31.     /**
  32.      * @var \DateTime
  33.      *
  34.      * @ORM\Column(type="datetime", nullable=true)
  35.      */
  36.     private $updatedAt;
  37.     /**
  38.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\User", inversedBy="userTest")
  39.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="cascade")
  40.      */
  41.     private $user;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity="Test", inversedBy="userTest")
  44.      * @ORM\JoinColumn(name="test_id", referencedColumnName="id", onDelete="cascade")
  45.      */
  46.     private $test;
  47.     /** @ORM\PrePersist() */
  48.     public function prePersist()
  49.     {
  50.         $this->createdAt = new \DateTime();
  51.     }
  52.     /** @ORM\PreUpdate() */
  53.     public function preUpdate()
  54.     {
  55.         $this->updatedAt = new \DateTime();
  56.     }
  57.     public function __toString()
  58.     {
  59.         return (string) $this->id;
  60.     }
  61.     public function getId(): ?int
  62.     {
  63.         return $this->id;
  64.     }
  65.     public function getDraft(): ?string
  66.     {
  67.         return $this->draft;
  68.     }
  69.     public function setDraft(string $draft): self
  70.     {
  71.         $this->draft $draft;
  72.         return $this;
  73.     }
  74.     public function getCreatedAt(): ?\DateTimeInterface
  75.     {
  76.         return $this->createdAt;
  77.     }
  78.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  79.     {
  80.         $this->createdAt $createdAt;
  81.         return $this;
  82.     }
  83.     public function getUpdatedAt(): ?\DateTimeInterface
  84.     {
  85.         return $this->updatedAt;
  86.     }
  87.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  88.     {
  89.         $this->updatedAt $updatedAt;
  90.         return $this;
  91.     }
  92.     public function getUser(): ?User
  93.     {
  94.         return $this->user;
  95.     }
  96.     public function setUser(?User $user): self
  97.     {
  98.         $this->user $user;
  99.         return $this;
  100.     }
  101.     public function getTest(): ?Test
  102.     {
  103.         return $this->test;
  104.     }
  105.     public function setTest(?Test $test): self
  106.     {
  107.         $this->test $test;
  108.         return $this;
  109.     }
  110.     /* ****************************** GETTERS & SETTERS ******************************  */
  111. }