src/Entity/Keyword.php line 21

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use App\Repository\KeywordRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Gedmo\Mapping\Annotation as Gedmo;
  10. /**
  11. * Keyword.
  12. *
  13. * @ORM\Table(name="Keyword")
  14. *
  15. * @ORM\Entity(repositoryClass=KeywordRepository::class)
  16. */
  17. class Keyword
  18. {
  19. /**
  20. * @var int
  21. *
  22. * @ORM\Column(name="id", type="integer")
  23. *
  24. * @ORM\Id
  25. *
  26. * @ORM\GeneratedValue(strategy="AUTO")
  27. */
  28. private $id;
  29. /**
  30. * @var string
  31. *
  32. * @ORM\Column(name="name", type="string", length=255, nullable=true)
  33. */
  34. private $name;
  35. /**
  36. * @Gedmo\Slug(fields={"name"})
  37. *
  38. * @ORM\Column(length=128, nullable=true)
  39. */
  40. private $slug;
  41. /**
  42. * @Gedmo\Timestampable(on="create")
  43. *
  44. * @ORM\Column(name="created", type="datetime")
  45. */
  46. private $created;
  47. /**
  48. * @ORM\Column(name="updated", type="datetime")
  49. *
  50. * @Gedmo\Timestampable(on="update")
  51. */
  52. private $updated;
  53. /**
  54. * @ORM\ManyToMany(targetEntity="FicheAction", mappedBy="keywords")
  55. */
  56. private $fichesAction;
  57. /**
  58. * Constructor.
  59. */
  60. public function __construct()
  61. {
  62. $this->fichesAction = new \Doctrine\Common\Collections\ArrayCollection();
  63. }
  64. #[\Override]
  65. public function __toString(): string
  66. {
  67. return $this->name;
  68. }
  69. /**
  70. * Get id.
  71. *
  72. * @return int
  73. */
  74. public function getId()
  75. {
  76. return $this->id;
  77. }
  78. /**
  79. * Set name.
  80. *
  81. * @param string $name
  82. */
  83. public function setName($name): static
  84. {
  85. $this->name = $name;
  86. return $this;
  87. }
  88. /**
  89. * Get name.
  90. *
  91. * @return string
  92. */
  93. public function getName()
  94. {
  95. return $this->name;
  96. }
  97. /**
  98. * Set slug.
  99. *
  100. * @param string $slug
  101. */
  102. public function setSlug($slug): static
  103. {
  104. $this->slug = $slug;
  105. return $this;
  106. }
  107. /**
  108. * Get slug.
  109. *
  110. * @return string
  111. */
  112. public function getSlug()
  113. {
  114. return $this->slug;
  115. }
  116. /**
  117. * Set created.
  118. *
  119. * @param \DateTime $created
  120. */
  121. public function setCreated($created): static
  122. {
  123. $this->created = $created;
  124. return $this;
  125. }
  126. /**
  127. * Get created.
  128. *
  129. * @return \DateTime
  130. */
  131. public function getCreated()
  132. {
  133. return $this->created;
  134. }
  135. /**
  136. * Set updated.
  137. *
  138. * @param \DateTime $updated
  139. */
  140. public function setUpdated($updated): static
  141. {
  142. $this->updated = $updated;
  143. return $this;
  144. }
  145. /**
  146. * Get updated.
  147. *
  148. * @return \DateTime
  149. */
  150. public function getUpdated()
  151. {
  152. return $this->updated;
  153. }
  154. /**
  155. * Add fichesAction.
  156. */
  157. public function addFichesAction(FicheAction $fichesAction): static
  158. {
  159. $this->fichesAction[] = $fichesAction;
  160. return $this;
  161. }
  162. /**
  163. * Remove fichesAction.
  164. */
  165. public function removeFichesAction(FicheAction $fichesAction): void
  166. {
  167. $this->fichesAction->removeElement($fichesAction);
  168. }
  169. /**
  170. * Get fichesAction.
  171. *
  172. * @return \Doctrine\Common\Collections\Collection
  173. */
  174. public function getFichesAction()
  175. {
  176. return $this->fichesAction;
  177. }
  178. }