Country.php 950 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\Core;
  4. use ApiPlatform\Metadata\ApiResource;
  5. use ApiPlatform\Metadata\Get;
  6. use ApiPlatform\Metadata\GetCollection;
  7. use App\Repository\Core\CountryRepository;
  8. // use DH\Auditor\Provider\Doctrine\Auditing\Annotation\Auditable;
  9. use Doctrine\ORM\Mapping as ORM;
  10. /**
  11. * Pays
  12. */
  13. #[ApiResource(
  14. operations: [
  15. new Get(),
  16. new GetCollection(),
  17. ],
  18. paginationEnabled: false
  19. )]
  20. // #[Auditable]
  21. #[ORM\Entity(repositoryClass: CountryRepository::class)]
  22. class Country
  23. {
  24. #[ORM\Id]
  25. #[ORM\Column]
  26. #[ORM\GeneratedValue]
  27. private ?int $id = null;
  28. #[ORM\Column(length: 255)]
  29. private string $name;
  30. public function getId(): ?int
  31. {
  32. return $this->id;
  33. }
  34. public function getName(): string
  35. {
  36. return $this->name;
  37. }
  38. public function setName(string $name): self
  39. {
  40. $this->name = $name;
  41. return $this;
  42. }
  43. }