src/Entity/NosGaranties.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\NosGarantiesRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity(repositoryClass=NosGarantiesRepository::class)
  7. */
  8. class NosGaranties
  9. {
  10. /**
  11. * @ORM\Id
  12. * @ORM\GeneratedValue
  13. * @ORM\Column(type="integer")
  14. */
  15. private $id;
  16. /**
  17. * @ORM\Column(type="string", length=255)
  18. */
  19. private $icone;
  20. /**
  21. * @ORM\Column(type="string", length=255)
  22. */
  23. private $titre;
  24. /**
  25. * @ORM\Column(type="text")
  26. */
  27. private $contenu;
  28. /**
  29. * @ORM\Column(type="boolean")
  30. */
  31. private $plier;
  32. public function getId(): ?int
  33. {
  34. return $this->id;
  35. }
  36. public function getIcone(): ?string
  37. {
  38. return $this->icone;
  39. }
  40. public function setIcone(string $icone): self
  41. {
  42. $this->icone = $icone;
  43. return $this;
  44. }
  45. public function getTitre(): ?string
  46. {
  47. return $this->titre;
  48. }
  49. public function setTitre(string $titre): self
  50. {
  51. $this->titre = $titre;
  52. return $this;
  53. }
  54. public function getContenu(): ?string
  55. {
  56. return $this->contenu;
  57. }
  58. public function setContenu(string $contenu): self
  59. {
  60. $this->contenu = $contenu;
  61. return $this;
  62. }
  63. public function getDisplayContent(){
  64. $pattern = '/h1/i';
  65. $replacement = 'h2';
  66. return preg_replace($pattern, $replacement, $this->contenu);
  67. }
  68. public function getPlier(): ?bool
  69. {
  70. return $this->plier;
  71. }
  72. public function setPlier(bool $plier): self
  73. {
  74. $this->plier = $plier;
  75. return $this;
  76. }
  77. }