src/Entity/NotificationProfile.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Interface\NotificationInterface;
  4. use App\Entity\Traits\TimestampTrait;
  5. use App\Repository\NotificationProfileRepository;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\Common\Collections\Collection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassNotificationProfileRepository::class)]
  10. class NotificationProfile implements NotificationInterface
  11. {
  12.     use TimestampTrait;
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column(type'integer')]
  16.     private $id;
  17.     #[ORM\Column(type'string'length255)]
  18.     private $notificationName;
  19.     #[ORM\Column(type'text')]
  20.     private $notificationContent;
  21.     #[ORM\Column(type'string'length255)]
  22.     private $notificationCondition;
  23.     #[ORM\Column(type'boolean')]
  24.     private $isEmail false;
  25.     #[ORM\OneToMany(mappedBy'notificationProfile'targetEntityNotification::class)]
  26.     private $notifications;
  27.     #[ORM\Column(type'string'length255)]
  28.     private $themeStyle;
  29.     #[ORM\ManyToMany(targetEntityRoleManagement::class, inversedBy'notificationProfiles')]
  30.     private $roleToSend;
  31.     public function __construct()
  32.     {
  33.         $this->notifications = new ArrayCollection();
  34.         $this->roleToSend = new ArrayCollection();
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getNotificationName(): ?string
  41.     {
  42.         return $this->notificationName;
  43.     }
  44.     public function setNotificationName(string $notificationName): self
  45.     {
  46.         $this->notificationName $notificationName;
  47.         return $this;
  48.     }
  49.     public function getNotificationContent(): ?string
  50.     {
  51.         return $this->notificationContent;
  52.     }
  53.     public function setNotificationContent(string $notificationContent): self
  54.     {
  55.         $this->notificationContent $notificationContent;
  56.         return $this;
  57.     }
  58.     public function getNotificationCondition(): ?string
  59.     {
  60.         return $this->notificationCondition;
  61.     }
  62.     public function setNotificationCondition(string $notificationCondition): self
  63.     {
  64.         $this->notificationCondition $notificationCondition;
  65.         return $this;
  66.     }
  67.     public function isIsEmail(): ?bool
  68.     {
  69.         return $this->isEmail;
  70.     }
  71.     public function setIsEmail(bool $isEmail): self
  72.     {
  73.         $this->isEmail $isEmail;
  74.         return $this;
  75.     }
  76.     /**
  77.      * @return Collection<int, Notification>
  78.      */
  79.     public function getNotifications(): Collection
  80.     {
  81.         return $this->notifications;
  82.     }
  83.     public function addNotification(Notification $notification): self
  84.     {
  85.         if (!$this->notifications->contains($notification)) {
  86.             $this->notifications[] = $notification;
  87.             $notification->setNotificationProfile($this);
  88.         }
  89.         return $this;
  90.     }
  91.     public function removeNotification(Notification $notification): self
  92.     {
  93.         if ($this->notifications->removeElement($notification)) {
  94.             // set the owning side to null (unless already changed)
  95.             if ($notification->getNotificationProfile() === $this) {
  96.                 $notification->setNotificationProfile(null);
  97.             }
  98.         }
  99.         return $this;
  100.     }
  101.     public function getThemeStyle(): ?string
  102.     {
  103.         return $this->themeStyle;
  104.     }
  105.     public function setThemeStyle(string $themeStyle): self
  106.     {
  107.         $this->themeStyle $themeStyle;
  108.         return $this;
  109.     }
  110.     /**
  111.      * @return Collection<int, RoleManagement>
  112.      */
  113.     public function getRoleToSend(): Collection
  114.     {
  115.         return $this->roleToSend;
  116.     }
  117.     public function addRoleToSend(RoleManagement $roleToSend): self
  118.     {
  119.         if (!$this->roleToSend->contains($roleToSend)) {
  120.             $this->roleToSend[] = $roleToSend;
  121.         }
  122.         return $this;
  123.     }
  124.     public function removeRoleToSend(RoleManagement $roleToSend): self
  125.     {
  126.         $this->roleToSend->removeElement($roleToSend);
  127.         return $this;
  128.     }
  129. }