Country.php 887 B

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