<?php
declare(strict_types=1);
namespace App\Entity;
use DateTimeImmutable;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\JoinColumn;
use Doctrine\ORM\Mapping\OneToOne;
/**
* Latest location-permission telemetry reported by the mobile app (see CreatorLocationPermissionController).
*/
#[Entity]
class UserLocationPermission
{
#[Id]
#[OneToOne(targetEntity: User::class)]
#[JoinColumn(name: 'id', unique: true, nullable: false, onDelete: 'CASCADE')]
private User $user;
#[Column(type: 'string', length: 32, nullable: true)]
private ?string $permission = null;
#[Column(type: 'boolean', nullable: true)]
private ?bool $servicesEnabled = null;
#[Column(type: 'datetime_immutable', nullable: true)]
private ?DateTimeImmutable $reportedAt = null;
public function getUser(): User
{
return $this->user;
}
public function setUser(User $user): static
{
$this->user = $user;
return $this;
}
public function getPermission(): ?string
{
return $this->permission;
}
public function setPermission(?string $permission): static
{
$this->permission = $permission;
return $this;
}
public function getServicesEnabled(): ?bool
{
return $this->servicesEnabled;
}
public function setServicesEnabled(?bool $servicesEnabled): static
{
$this->servicesEnabled = $servicesEnabled;
return $this;
}
public function getReportedAt(): ?DateTimeImmutable
{
return $this->reportedAt;
}
public function setReportedAt(?DateTimeImmutable $reportedAt): static
{
$this->reportedAt = $reportedAt;
return $this;
}
}