| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- declare(strict_types=1);
- namespace App\Entity\Core;
- use ApiPlatform\Core\Annotation\ApiResource;
- use App\Repository\Core\CountryRepository;
- use Doctrine\ORM\Mapping as ORM;
- #[ApiResource(
- collectionOperations: ['get'],
- itemOperations: ['get'],
- attributes:[
- 'pagination_enabled' => false
- ]
- )]
- #[ORM\Entity(repositoryClass: CountryRepository::class)]
- class Country
- {
- #[ORM\Id]
- #[ORM\Column]
- #[ORM\GeneratedValue]
- private ?int $id = null;
- #[ORM\Column(length: 255)]
- private string $name;
- public function getId(): ?int
- {
- return $this->id;
- }
- public function getName(): string
- {
- return $this->name;
- }
- public function setName(string $name): self
- {
- $this->name = $name;
- return $this;
- }
- }
|