src/Entity/UserLocationPermission.php line 18

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use DateTimeImmutable;
  5. use Doctrine\ORM\Mapping\Column;
  6. use Doctrine\ORM\Mapping\Entity;
  7. use Doctrine\ORM\Mapping\Id;
  8. use Doctrine\ORM\Mapping\JoinColumn;
  9. use Doctrine\ORM\Mapping\OneToOne;
  10. /**
  11.  * Latest location-permission telemetry reported by the mobile app (see CreatorLocationPermissionController).
  12.  */
  13. #[Entity]
  14. class UserLocationPermission
  15. {
  16.     #[Id]
  17.     #[OneToOne(targetEntityUser::class)]
  18.     #[JoinColumn(name'id'uniquetruenullablefalseonDelete'CASCADE')]
  19.     private User $user;
  20.     #[Column(type'string'length32nullabletrue)]
  21.     private ?string $permission null;
  22.     #[Column(type'boolean'nullabletrue)]
  23.     private ?bool $servicesEnabled null;
  24.     #[Column(type'datetime_immutable'nullabletrue)]
  25.     private ?DateTimeImmutable $reportedAt null;
  26.     public function getUser(): User
  27.     {
  28.         return $this->user;
  29.     }
  30.     public function setUser(User $user): static
  31.     {
  32.         $this->user $user;
  33.         return $this;
  34.     }
  35.     public function getPermission(): ?string
  36.     {
  37.         return $this->permission;
  38.     }
  39.     public function setPermission(?string $permission): static
  40.     {
  41.         $this->permission $permission;
  42.         return $this;
  43.     }
  44.     public function getServicesEnabled(): ?bool
  45.     {
  46.         return $this->servicesEnabled;
  47.     }
  48.     public function setServicesEnabled(?bool $servicesEnabled): static
  49.     {
  50.         $this->servicesEnabled $servicesEnabled;
  51.         return $this;
  52.     }
  53.     public function getReportedAt(): ?DateTimeImmutable
  54.     {
  55.         return $this->reportedAt;
  56.     }
  57.     public function setReportedAt(?DateTimeImmutable $reportedAt): static
  58.     {
  59.         $this->reportedAt $reportedAt;
  60.         return $this;
  61.     }
  62. }