src/Entity/Notification.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\NotificationRepository;
  5. use App\Traits\Actions;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassNotificationRepository::class)]
  9. #[ORM\Table(name'hs_tc_notification')]
  10. #[ApiResource]
  11. class Notification
  12. {
  13.     use Actions;
  14.     #[ORM\ManyToOne(inversedBy'notifications')]
  15.     #[ORM\JoinColumn(nullablefalse)]
  16.     private ?User $user null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $subject null;
  19.     #[ORM\Column(length255)]
  20.     private ?string $link null;
  21.     public function __construct()
  22.     {
  23.         // date_default_timezone_set('Africa/Casablanca');
  24.         $this->createAt=new \DateTime('now');
  25.         $this->published=false;
  26.     }
  27.     public function getUser(): ?User
  28.     {
  29.         return $this->user;
  30.     }
  31.     public function setUser(?User $user): self
  32.     {
  33.         $this->user $user;
  34.         return $this;
  35.     }
  36.     public function getSubject(): ?string
  37.     {
  38.         return $this->subject;
  39.     }
  40.     public function setSubject(string $subject): self
  41.     {
  42.         $this->subject $subject;
  43.         return $this;
  44.     }
  45.     public function getLink(): ?string
  46.     {
  47.         return $this->link;
  48.     }
  49.     public function setLink(string $link): self
  50.     {
  51.         $this->link $link;
  52.         return $this;
  53.     }
  54. }