src/Entity/VilleDesservie.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\VilleDesservieRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Cocur\Slugify\Slugify;
  6. /**
  7. * @ORM\Entity(repositoryClass=VilleDesservieRepository::class)
  8. */
  9. class VilleDesservie
  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. */
  20. private $title;
  21. /**
  22. * @ORM\Column(type="text", nullable=true)
  23. */
  24. private $bottomDescription;
  25. /**
  26. * @ORM\Column(type="text", nullable=true)
  27. */
  28. private $topDescription;
  29. /**
  30. * @ORM\Column(type="boolean", nullable=true)
  31. */
  32. private $isActive;
  33. /**
  34. * @ORM\Column(type="string", length=255, nullable=true)
  35. */
  36. private $slug;
  37. public function getId(): ?int
  38. {
  39. return $this->id;
  40. }
  41. public function getTitle(): ?string
  42. {
  43. return $this->title;
  44. }
  45. public function setTitle(string $title): self
  46. {
  47. $this->title = $title;
  48. $slugify = new Slugify();
  49. $this->slug = $slugify->Slugify($title,'_');
  50. return $this;
  51. }
  52. public function getBottomDescription(): ?string
  53. {
  54. return $this->bottomDescription;
  55. }
  56. public function setBottomDescription(?string $bottomDescription): self
  57. {
  58. $this->bottomDescription = $bottomDescription;
  59. return $this;
  60. }
  61. public function getTopDescription(): ?string
  62. {
  63. return $this->topDescription;
  64. }
  65. public function setTopDescription(?string $topDescription): self
  66. {
  67. $this->topDescription = $topDescription;
  68. return $this;
  69. }
  70. public function getIsActive(): ?bool
  71. {
  72. return $this->isActive;
  73. }
  74. public function setIsActive(?bool $isActive): self
  75. {
  76. $this->isActive = $isActive;
  77. return $this;
  78. }
  79. public function getSlug(): ?string
  80. {
  81. return $this->slug;
  82. }
  83. public function setSlug(?string $slug): self
  84. {
  85. $this->slug = $slug;
  86. return $this;
  87. }
  88. }