<?phpnamespace App\Entity\Gos\Uniqskills;use App\Entity\Gos\User;use Doctrine\ORM\Mapping as ORM;use Gedmo\Mapping\Annotation as Gedmo;/** * @ORM\Table() * @ORM\Entity(repositoryClass="App\Repository\Gos\Uniqskills\UserLessonRepository") * @ORM\HasLifecycleCallbacks */class UserLesson{ /** * @ORM\Column(type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ private $id; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime", nullable=true) */ private $updatedAt; /** * @ORM\ManyToOne(targetEntity="Lesson", inversedBy="userLesson") * @ORM\JoinColumn(onDelete="CASCADE") */ private $lesson; /** * @ORM\ManyToOne(targetEntity="App\Entity\Gos\User", inversedBy="userLesson") * @ORM\JoinColumn(onDelete="CASCADE") */ private $user; /** * @ORM\Column(type="integer", nullable=true) */ private $tempId; /** @ORM\PrePersist() */ public function prePersist() { $this->createdAt = new \DateTime(); } /** @ORM\PreUpdate() */ public function preUpdate() { $this->updatedAt = new \DateTime(); } public function __toString() { return (string)$this->name; } public function __clone() { $this->id = null; $this->updatedAt = null; } /* ****************************** GETTERS & SETTERS ****************************** */ public function getId(): ?int { return $this->id; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(?\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; return $this; } public function getLesson(): ?Lesson { return $this->lesson; } public function setLesson(?Lesson $lesson): self { $this->lesson = $lesson; return $this; } public function getUser(): ?User { return $this->user; } public function setUser(?User $user): self { $this->user = $user; return $this; } public function getTempId(): ?int { return $this->tempId; } public function setTempId(?int $tempId): self { $this->tempId = $tempId; return $this; }}