Country.php 810 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 Doctrine\ORM\Mapping as ORM;
  7. #[ApiResource(
  8. collectionOperations: ['get'],
  9. itemOperations: ['get'],
  10. attributes:[
  11. 'pagination_enabled' => false
  12. ]
  13. )]
  14. #[ORM\Entity(repositoryClass: CountryRepository::class)]
  15. class Country
  16. {
  17. #[ORM\Id]
  18. #[ORM\Column]
  19. #[ORM\GeneratedValue]
  20. private ?int $id = null;
  21. #[ORM\Column(length: 255)]
  22. private string $name;
  23. public function getId(): ?int
  24. {
  25. return $this->id;
  26. }
  27. public function getName(): string
  28. {
  29. return $this->name;
  30. }
  31. public function setName(string $name): self
  32. {
  33. $this->name = $name;
  34. return $this;
  35. }
  36. }