Country.php 934 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. #[ApiResource(
  11. operations: [
  12. new Get(),
  13. new GetCollection(),
  14. ],
  15. paginationEnabled: false
  16. )]
  17. // #[Auditable]
  18. #[ORM\Entity(repositoryClass: CountryRepository::class)]
  19. class Country
  20. {
  21. #[ORM\Id]
  22. #[ORM\Column]
  23. #[ORM\GeneratedValue]
  24. private ?int $id = null;
  25. #[ORM\Column(length: 255)]
  26. private string $name;
  27. public function getId(): ?int
  28. {
  29. return $this->id;
  30. }
  31. public function getName(): string
  32. {
  33. return $this->name;
  34. }
  35. public function setName(string $name): self
  36. {
  37. $this->name = $name;
  38. return $this;
  39. }
  40. }