src/Entity/NotificationPreference.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\NotificationPreferenceRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use App\Entity\User;
  6. /**
  7.  * @ORM\Entity(repositoryClass=NotificationPreferenceRepository::class)
  8.  */
  9. class NotificationPreference
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private ?int $id null;
  17.     /**
  18.      * @ORM\OneToOne(targetEntity=User::class, inversedBy="notificationPreference", cascade={"persist","remove"})
  19.      * @ORM\JoinColumn(nullable=false)
  20.      */
  21.     private ?User $user null;
  22.     /**
  23.      * @ORM\Column(type="json", nullable=true)
  24.      */
  25.     private ?array $categories null;
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getUser(): ?User
  31.     {
  32.         return $this->user;
  33.     }
  34.     public function setUser(User $user): self
  35.     {
  36.         $this->user $user;
  37.         return $this;
  38.     }
  39.     public function getCategories(): ?array
  40.     {
  41.         return $this->categories;
  42.     }
  43.     public function setCategories(?array $categories): self
  44.     {
  45.         $this->categories $categories;
  46.         return $this;
  47.     }
  48. }