src/Entity/Gos/Uniqskills/UserLesson.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\UserLessonRepository")
  9.  * @ORM\HasLifecycleCallbacks
  10.  */
  11. class UserLesson
  12. {
  13.     /**
  14.      * @ORM\Column(type="integer")
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue(strategy="IDENTITY")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="datetime")
  21.      */
  22.     private $createdAt;
  23.     /**
  24.      * @ORM\Column(type="datetime", nullable=true)
  25.      */
  26.     private $updatedAt;
  27.     /**
  28.      * @ORM\ManyToOne(targetEntity="Lesson", inversedBy="userLesson")
  29.      * @ORM\JoinColumn(onDelete="CASCADE")
  30.      */
  31.     private $lesson;
  32.     /**
  33.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\User", inversedBy="userLesson")
  34.      * @ORM\JoinColumn(onDelete="CASCADE")
  35.      */
  36.     private $user;
  37.     /**
  38.      * @ORM\Column(type="integer", nullable=true)
  39.      */
  40.     private $tempId;
  41.     /** @ORM\PrePersist() */
  42.     public function prePersist()
  43.     {
  44.         $this->createdAt = new \DateTime();
  45.     }
  46.     /** @ORM\PreUpdate() */
  47.     public function preUpdate()
  48.     {
  49.         $this->updatedAt = new \DateTime();
  50.     }
  51.     public function __toString()
  52.     {
  53.         return (string)$this->name;
  54.     }
  55.     public function __clone()
  56.     {
  57.         $this->id           null;
  58.         $this->updatedAt    null;
  59.     }
  60.     /* ****************************** GETTERS & SETTERS ******************************  */
  61.     public function getId(): ?int
  62.     {
  63.         return $this->id;
  64.     }
  65.     public function getCreatedAt(): ?\DateTimeInterface
  66.     {
  67.         return $this->createdAt;
  68.     }
  69.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  70.     {
  71.         $this->createdAt $createdAt;
  72.         return $this;
  73.     }
  74.     public function getUpdatedAt(): ?\DateTimeInterface
  75.     {
  76.         return $this->updatedAt;
  77.     }
  78.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  79.     {
  80.         $this->updatedAt $updatedAt;
  81.         return $this;
  82.     }
  83.     public function getLesson(): ?Lesson
  84.     {
  85.         return $this->lesson;
  86.     }
  87.     public function setLesson(?Lesson $lesson): self
  88.     {
  89.         $this->lesson $lesson;
  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 getTempId(): ?int
  102.     {
  103.         return $this->tempId;
  104.     }
  105.     public function setTempId(?int $tempId): self
  106.     {
  107.         $this->tempId $tempId;
  108.         return $this;
  109.     }
  110. }