Tag.php 695 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TagRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClass: TagRepository::class)]
  6. class Tag implements \Stringable
  7. {
  8. #[ORM\Id]
  9. #[ORM\GeneratedValue]
  10. #[ORM\Column]
  11. private ?int $id = null;
  12. #[ORM\Column(length: 50)]
  13. private ?string $name = null;
  14. public function __toString(): string
  15. {
  16. return $this->getName();
  17. }
  18. public function getId(): ?int
  19. {
  20. return $this->id;
  21. }
  22. public function getName(): ?string
  23. {
  24. return $this->name;
  25. }
  26. public function setName(string $name): static
  27. {
  28. $this->name = $name;
  29. return $this;
  30. }
  31. }