src/Entity/Expertise.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ExpertiseRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=ExpertiseRepository::class)
  9. */
  10. class Expertise
  11. {
  12. /**
  13. * @ORM\Id
  14. * @ORM\GeneratedValue
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\Column(type="string", length=255)
  20. */
  21. private $title;
  22. /**
  23. * @ORM\Column(type="string", length=255)
  24. */
  25. private $slug;
  26. /**
  27. * @ORM\Column(type="text", nullable=true)
  28. */
  29. private $shortDescription;
  30. /**
  31. * @ORM\Column(type="text", nullable=true)
  32. */
  33. private $description;
  34. /**
  35. * @ORM\Column(type="string", length=255, nullable=true)
  36. */
  37. private $icon;
  38. /**
  39. * @ORM\Column(type="string", length=255, nullable=true)
  40. */
  41. private $metaTitle;
  42. /**
  43. * @ORM\Column(type="text", nullable=true)
  44. */
  45. private $metaDescription;
  46. /**
  47. * @ORM\OneToMany(targetEntity=Faq::class, mappedBy="expertise")
  48. */
  49. private $faqs;
  50. public function __construct()
  51. {
  52. $this->faqs = new ArrayCollection();
  53. }
  54. public function getId(): ?int
  55. {
  56. return $this->id;
  57. }
  58. public function getTitle(): ?string
  59. {
  60. return $this->title;
  61. }
  62. public function setTitle(string $title): self
  63. {
  64. $this->title = $title;
  65. return $this;
  66. }
  67. public function getSlug(): ?string
  68. {
  69. return $this->slug;
  70. }
  71. public function setSlug(string $slug): self
  72. {
  73. $this->slug = $slug;
  74. return $this;
  75. }
  76. public function getShortDescription(): ?string
  77. {
  78. return $this->shortDescription;
  79. }
  80. public function setShortDescription(?string $shortDescription): self
  81. {
  82. $this->shortDescription = $shortDescription;
  83. return $this;
  84. }
  85. public function getDescription(): ?string
  86. {
  87. return $this->description;
  88. }
  89. public function setDescription(?string $description): self
  90. {
  91. $this->description = $description;
  92. return $this;
  93. }
  94. public function getIcon(): ?string
  95. {
  96. return $this->icon;
  97. }
  98. public function setIcon(?string $icon): self
  99. {
  100. $this->icon = $icon;
  101. return $this;
  102. }
  103. public function getMetaTitle(): ?string
  104. {
  105. return $this->metaTitle;
  106. }
  107. public function setMetaTitle(?string $metaTitle): self
  108. {
  109. $this->metaTitle = $metaTitle;
  110. return $this;
  111. }
  112. public function getMetaDescription(): ?string
  113. {
  114. return $this->metaDescription;
  115. }
  116. public function setMetaDescription(?string $metaDescription): self
  117. {
  118. $this->metaDescription = $metaDescription;
  119. return $this;
  120. }
  121. /**
  122. * @return Collection|Faq[]
  123. */
  124. public function getFaqs(): Collection
  125. {
  126. return $this->faqs;
  127. }
  128. public function addFaq(Faq $faq): self
  129. {
  130. if (!$this->faqs->contains($faq)) {
  131. $this->faqs[] = $faq;
  132. $faq->setExpertise($this);
  133. }
  134. return $this;
  135. }
  136. public function removeFaq(Faq $faq): self
  137. {
  138. if ($this->faqs->removeElement($faq)) {
  139. // set the owning side to null (unless already changed)
  140. if ($faq->getExpertise() === $this) {
  141. $faq->setExpertise(null);
  142. }
  143. }
  144. return $this;
  145. }
  146. }