<?phpnamespace App\Entity;use App\Entity\Interface\NotificationInterface;use App\Entity\Traits\TimestampTrait;use App\Repository\NotificationProfileRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: NotificationProfileRepository::class)]class NotificationProfile implements NotificationInterface{ use TimestampTrait; #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\Column(type: 'string', length: 255)] private $notificationName; #[ORM\Column(type: 'text')] private $notificationContent; #[ORM\Column(type: 'string', length: 255)] private $notificationCondition; #[ORM\Column(type: 'boolean')] private $isEmail = false; #[ORM\OneToMany(mappedBy: 'notificationProfile', targetEntity: Notification::class)] private $notifications; #[ORM\Column(type: 'string', length: 255)] private $themeStyle; #[ORM\ManyToMany(targetEntity: RoleManagement::class, inversedBy: 'notificationProfiles')] private $roleToSend; public function __construct() { $this->notifications = new ArrayCollection(); $this->roleToSend = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getNotificationName(): ?string { return $this->notificationName; } public function setNotificationName(string $notificationName): self { $this->notificationName = $notificationName; return $this; } public function getNotificationContent(): ?string { return $this->notificationContent; } public function setNotificationContent(string $notificationContent): self { $this->notificationContent = $notificationContent; return $this; } public function getNotificationCondition(): ?string { return $this->notificationCondition; } public function setNotificationCondition(string $notificationCondition): self { $this->notificationCondition = $notificationCondition; return $this; } public function isIsEmail(): ?bool { return $this->isEmail; } public function setIsEmail(bool $isEmail): self { $this->isEmail = $isEmail; return $this; } /** * @return Collection<int, Notification> */ public function getNotifications(): Collection { return $this->notifications; } public function addNotification(Notification $notification): self { if (!$this->notifications->contains($notification)) { $this->notifications[] = $notification; $notification->setNotificationProfile($this); } return $this; } public function removeNotification(Notification $notification): self { if ($this->notifications->removeElement($notification)) { // set the owning side to null (unless already changed) if ($notification->getNotificationProfile() === $this) { $notification->setNotificationProfile(null); } } return $this; } public function getThemeStyle(): ?string { return $this->themeStyle; } public function setThemeStyle(string $themeStyle): self { $this->themeStyle = $themeStyle; return $this; } /** * @return Collection<int, RoleManagement> */ public function getRoleToSend(): Collection { return $this->roleToSend; } public function addRoleToSend(RoleManagement $roleToSend): self { if (!$this->roleToSend->contains($roleToSend)) { $this->roleToSend[] = $roleToSend; } return $this; } public function removeRoleToSend(RoleManagement $roleToSend): self { $this->roleToSend->removeElement($roleToSend); return $this; }}