src/Entity/MentionsLegales.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MentionsLegalesRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Entity(repositoryClass=MentionsLegalesRepository::class)
  7. */
  8. class MentionsLegales
  9. {
  10. /**
  11. * @ORM\Id
  12. * @ORM\GeneratedValue
  13. * @ORM\Column(type="integer")
  14. */
  15. private $id;
  16. /**
  17. * @ORM\Column(type="string", length=1000000)
  18. */
  19. private $contenu;
  20. public function getId(): ?int
  21. {
  22. return $this->id;
  23. }
  24. public function getContenu(): ?string
  25. {
  26. return $this->contenu;
  27. }
  28. public function setContenu(string $contenu): self
  29. {
  30. $this->contenu = $contenu;
  31. return $this;
  32. }
  33. public function getDisplayContent(){
  34. $pattern = '/h1/i';
  35. $replacement = 'h2';
  36. return preg_replace($pattern, $replacement, $this->contenu);
  37. }
  38. }