src/Entity/CRM/Notification.php line 13

  1. <?php
  2. namespace App\Entity\CRM;
  3. use App\Repository\NotificationRepository;
  4. use DateTime;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassNotificationRepository::class)]
  10. class Notification
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\Column(typeTypes::TEXT)]
  17.     private ?string $title null;
  18.     #[ORM\ManyToMany(targetEntityAdmin::class, inversedBy'notifications')]
  19.     private Collection $admin;
  20.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  21.     private ?\DateTimeInterface $date;
  22.     #[ORM\Column]
  23.     private ?bool $showed false;
  24.     #[ORM\ManyToMany(targetEntityConsultant::class, inversedBy'notifications')]
  25.     private Collection $consultant;
  26.     #[ORM\ManyToOne(inversedBy'notifications')]
  27.     private ?Branch $branch null;
  28.     #[ORM\Column(nullabletrue)]
  29.     private ?array $icons = [];
  30.     public function __construct()
  31.     {
  32.         $this->admin = new ArrayCollection();
  33.         $this->date = new DateTime();
  34.         $this->consultant = new ArrayCollection();
  35.         $this->icons null;
  36.     }
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getTitle(): ?string
  42.     {
  43.         return $this->title;
  44.     }
  45.     public function setTitle(string $title): static
  46.     {
  47.         $this->title $title;
  48.         return $this;
  49.     }
  50.     /**
  51.      * @return Collection<int, Admin>
  52.      */
  53.     public function getAdmin(): Collection
  54.     {
  55.         return $this->admin;
  56.     }
  57.     public function addAdmin(Admin $admin): static
  58.     {
  59.         if (!$this->admin->contains($admin)) {
  60.             $this->admin->add($admin);
  61.         }
  62.         return $this;
  63.     }
  64.     public function removeAdmin(Admin $admin): static
  65.     {
  66.         $this->admin->removeElement($admin);
  67.         return $this;
  68.     }
  69.     public function getDate(): ?\DateTimeInterface
  70.     {
  71.         return $this->date;
  72.     }
  73.     public function setDate(\DateTimeInterface $date): static
  74.     {
  75.         $this->date $date;
  76.         return $this;
  77.     }
  78.     public function isShowed(): ?bool
  79.     {
  80.         return $this->showed;
  81.     }
  82.     public function setShowed(bool $showed): static
  83.     {
  84.         $this->showed $showed;
  85.         return $this;
  86.     }
  87.     /**
  88.      * @return Collection<int, consultant>
  89.      */
  90.     public function getConsultant(): Collection
  91.     {
  92.         return $this->consultant;
  93.     }
  94.     public function addConsultant(consultant $consultant): static
  95.     {
  96.         if (!$this->consultant->contains($consultant)) {
  97.             $this->consultant->add($consultant);
  98.         }
  99.         return $this;
  100.     }
  101.     public function removeConsultant(consultant $consultant): static
  102.     {
  103.         $this->consultant->removeElement($consultant);
  104.         return $this;
  105.     }
  106.     public function getBranch(): ?Branch
  107.     {
  108.         return $this->branch;
  109.     }
  110.     public function setBranch(?Branch $branch): static
  111.     {
  112.         $this->branch $branch;
  113.         return $this;
  114.     }
  115.     public function getIcons(): ?array
  116.     {
  117.         return $this->icons;
  118.     }
  119.     public function setIcons(?array $icons): static
  120.     {
  121.         $this->icons $icons;
  122.         return $this;
  123.     }
  124.     public function addIcon(int $icon): static
  125.     {
  126.         $this->icons[]= $icon;
  127.         return $this;
  128.     }
  129. }