src/Entity/Presentation.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PresentationRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7. * @ORM\Entity(repositoryClass=PresentationRepository::class)
  8. */
  9. class Presentation
  10. {
  11. /**
  12. * @ORM\Id
  13. * @ORM\GeneratedValue
  14. * @ORM\Column(type="integer")
  15. */
  16. private $id;
  17. /**
  18. * @ORM\Column(type="string", length=255)
  19. * @Assert\NotBlank()
  20. */
  21. private $titre;
  22. /**
  23. * @ORM\Column(type="string", length=255,nullable="true")
  24. */
  25. private $icone;
  26. /**
  27. * @ORM\Column(type="text")
  28. */
  29. private $description;
  30. /**
  31. * @ORM\Column(type="boolean")
  32. */
  33. private $sombre;
  34. /**
  35. * @ORM\Column(type="string", length=255)
  36. * @Assert\NotBlank()
  37. */
  38. private $image;
  39. /**
  40. * @ORM\Column(type="string", length=255, nullable=true)
  41. */
  42. private $lien;
  43. public function getId(): ?int
  44. {
  45. return $this->id;
  46. }
  47. public function getTitre(): ?string
  48. {
  49. return $this->titre;
  50. }
  51. public function setTitre(string $titre): self
  52. {
  53. $this->titre = $titre;
  54. return $this;
  55. }
  56. public function getIcone(): ?string
  57. {
  58. return $this->icone;
  59. }
  60. public function setIcone(?string $icone): self
  61. {
  62. $this->icone = $icone;
  63. return $this;
  64. }
  65. public function getDescription(): ?string
  66. {
  67. return $this->description;
  68. }
  69. public function setDescription(string $description): self
  70. {
  71. $this->description = $description;
  72. return $this;
  73. }
  74. public function getSombre(): ?bool
  75. {
  76. return $this->sombre;
  77. }
  78. public function setSombre(bool $sombre): self
  79. {
  80. $this->sombre = $sombre;
  81. return $this;
  82. }
  83. public function getImage(): ?string
  84. {
  85. return $this->image;
  86. }
  87. public function setImage(?string $image): self
  88. {
  89. $this->image = $image;
  90. return $this;
  91. }
  92. public function getAbsoluteImage() : ?string
  93. {
  94. if(!empty($this->image)){
  95. return sprintf("https://%s/websiteImage/%s",$_SERVER['HTTP_HOST'],$this->image);
  96. }
  97. return null;
  98. }
  99. public function getLien(): ?string
  100. {
  101. return $this->lien;
  102. }
  103. public function setLien(?string $lien): self
  104. {
  105. $this->lien = $lien;
  106. return $this;
  107. }
  108. }