src/Entity/Device.php line 10

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DeviceRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassDeviceRepository::class)]
  7. class Device
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\ManyToOne(inversedBy'devices')]
  14.     private ?User $deviceToken null;
  15.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  16.     private ?string $token null;
  17.     #[ORM\Column(nullabletrue)]
  18.     private ?\DateTimeImmutable $createdAt null;
  19.     #[ORM\Column(nullabletrue)]
  20.     private ?\DateTimeImmutable $updatedAt null;
  21.     public function getId(): ?int
  22.     {
  23.         return $this->id;
  24.     }
  25.     public function getDeviceToken(): ?User
  26.     {
  27.         return $this->deviceToken;
  28.     }
  29.     public function setDeviceToken(?User $deviceToken): static
  30.     {
  31.         $this->deviceToken $deviceToken;
  32.         return $this;
  33.     }
  34.     public function getToken(): ?string
  35.     {
  36.         return $this->token;
  37.     }
  38.     public function setToken(?string $token): static
  39.     {
  40.         $this->token $token;
  41.         return $this;
  42.     }
  43.     public function getCreatedAt(): ?\DateTimeImmutable
  44.     {
  45.         return $this->createdAt;
  46.     }
  47.     public function setCreatedAt(?\DateTimeImmutable $createdAt): static
  48.     {
  49.         $this->createdAt $createdAt;
  50.         return $this;
  51.     }
  52.     public function getUpdatedAt(): ?\DateTimeImmutable
  53.     {
  54.         return $this->updatedAt;
  55.     }
  56.     public function setUpdatedAt(?\DateTimeImmutable $updatedAt): static
  57.     {
  58.         $this->updatedAt $updatedAt;
  59.         return $this;
  60.     }
  61. }