<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use ApiPlatform\Metadata\ApiResource;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Table(name: 'country')]
#[ORM\Entity]
#[ApiResource(normalizationContext: ['groups' => ['country.get','document.get']])]
class Country
{
#[ORM\Column(name: 'id', type: 'integer', nullable: false)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
#[Groups(['country.get','document.get','site.get'])]
private int $id;
#[ORM\Column(name: 'name', type: 'string', nullable: false)]
#[Groups(['country.get','document.get','site.get'])]
private string $name;
#[ORM\Column(length: 20)]
#[Groups(['country.get','document.get','site.get'])]
private ?string $code = null;
public function getId(): ?int
{
return $this->id;
}
public function getName(): string
{
return $this->name;
}
public function setName($name): self
{
$this->name = $name;
return $this;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): self
{
$this->code = $code;
return $this;
}
}