<?phpnamespace App\Entity;use App\Entity\Traits\TimeStampable;use App\Repository\DistrictRepository;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;use App\Entity\Traits\TimeStampableTrait;use Symfony\Component\Serializer\Annotation\Groups;#[ORM\Entity(repositoryClass: DistrictRepository::class)]#[ORM\HasLifecycleCallbacks]class District{ use TimeStampable; #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] #[Groups(["entity:write"])] private ?int $id = null; #[ORM\Column(length: 45)] #[Groups(["entity:write"])] #[Assert\NotBlank(message: 'Le nom du quartier est obligatoire.')] private ?string $name = null; #[ORM\Column(type: 'decimal', precision: 10, scale: 8, nullable: true)] private ?string $latitude; #[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 8, nullable: true)] private ?string $longitude = null; #[ORM\ManyToOne(inversedBy: 'districts')] #[Assert\NotBlank(message: 'Le nom de la commune est obligatoire.')] private ?Municipality $municipality = null; #[ORM\ManyToOne] private ?User $createdBy = null; public function __construct() { $this->createdAt = new \DateTimeImmutable(); $this->updatedAt = new \DateTimeImmutable(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getLatitude(): ?string { return $this->latitude; } public function setLatitude(?string $latitude): self { $this->latitude = $latitude; return $this; } public function getLongitude(): ?string { return $this->longitude; } public function setLongitude(?string $longitude): self { $this->longitude = $longitude; return $this; } public function getMunicipality(): ?Municipality { return $this->municipality; } public function setMunicipality(?Municipality $municipality): self { $this->municipality = $municipality; return $this; } public function getCreatedBy(): ?User { return $this->createdBy; } public function setCreatedBy(?User $createdBy): self { $this->createdBy = $createdBy; return $this; }}