src/Entity/Partenaire.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PartenaireRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. /**
  7. * @ORM\Entity(repositoryClass=PartenaireRepository::class)
  8. * @UniqueEntity(
  9. * fields={"name"},
  10. * errorPath="name",
  11. * message="Un partenaire existe avec le même nom"
  12. * )
  13. */
  14. class Partenaire
  15. {
  16. /**
  17. * @ORM\Id
  18. * @ORM\GeneratedValue
  19. * @ORM\Column(type="integer")
  20. */
  21. private $id;
  22. /**
  23. * @ORM\Column(type="string", length=255)
  24. */
  25. private $name;
  26. /**
  27. * @ORM\OneToOne(targetEntity=ImageManager::class, cascade={"persist", "remove"})
  28. */
  29. private $logo;
  30. public function getId(): ?int
  31. {
  32. return $this->id;
  33. }
  34. public function getName(): ?string
  35. {
  36. return $this->name;
  37. }
  38. public function setName(string $name): self
  39. {
  40. $this->name = $name;
  41. return $this;
  42. }
  43. public function getLogo(): ?ImageManager
  44. {
  45. return $this->logo;
  46. }
  47. public function setLogo(?ImageManager $logo): self
  48. {
  49. $this->logo = $logo;
  50. return $this;
  51. }
  52. }