<?phpnamespace App\Entity\Gos;use App\Entity\Gos\Uniqskills\Course;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Table() * @ORM\Entity(repositoryClass="App\Repository\Gos\NotificationForUserRepository") * @ORM\HasLifecycleCallbacks() */class NotificationForUser{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="text", nullable=true) */ private $message; /** * @ORM\ManyToMany(targetEntity="App\Entity\Gos\Uniqskills\Course", inversedBy="notificationForUsers") * @ORM\JoinTable(name="notification_for_user_course") */ private $courses; /** * @ORM\ManyToOne(targetEntity="Language", inversedBy="notificationForUser") */ private $language; /** * @ORM\OneToMany(targetEntity="UserNotification", mappedBy="notificationForUser") */ private $userNotification; /** * @ORM\Column(type="datetime", nullable=true) */ private $termValidity; /** * @ORM\Column(type="datetime", nullable=true) */ private $publishAt; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime", nullable=true) */ private $updatedAt; /** * @ORM\ManyToOne(targetEntity=PortalSettings::class) */ private $portalSettings; public function __construct() { $this->userNotification = new ArrayCollection(); $this->courses = new ArrayCollection(); } /** @ORM\PrePersist() */ public function onPrePersist() { $this->createdAt = new \DateTime(); } /** @ORM\PreUpdate() */ public function onPreUpdate() { $this->updatedAt = new \DateTime(); } public function __toString() { return $this->name; } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getMessage(): ?string { return $this->message; } public function setMessage(?string $message): self { $this->message = $message; return $this; } public function getCourses(): Collection { return $this->courses; } public function addCourses(Course $course): self { if (!$this->courses->contains($course)) { $this->courses[] = $course; } return $this; } public function removeCourses(Course $course): self { if ($this->courses->contains($course)) { $this->courses->removeElement($course); } return $this; } public function getLanguage(): ?Language { return $this->language; } public function setLanguage(?Language $language): self { $this->language = $language; return $this; } public function getUserNotification(): ?UserNotification { return $this->userNotification; } public function addUserNotification(UserNotification $userNotification): self { if (!$this->userNotification->contains($userNotification)) { $this->userNotification[] = $userNotification; $userNotification->setUser($this); } return $this; } public function removeUserNotification(userNotification $userNotification): self { if ($this->userNotification->contains($userNotification)) { $this->userNotification->removeElement($userNotification); if ($userNotification->getUser() === $this) { $userNotification->setUser(null); } } return $this; } public function getTermValidity(): ?\DateTimeInterface { return $this->termValidity; } public function setTermValidity(?\DateTimeInterface $termValidity): self { $this->termValidity = $termValidity; return $this; } public function getPublishAt(): ?\DateTimeInterface { return $this->publishAt; } public function setPublishAt(?\DateTimeInterface $publishAt): self { $this->publishAt = $publishAt; return $this; } 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 getPortalSettings(): ?PortalSettings { return $this->portalSettings; } public function setPortalSettings(?PortalSettings $portalSettings): self { $this->portalSettings = $portalSettings; return $this; }}