src/Entity/Cvs/JobsFilters.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Cvs;
  3. use Symfony\Component\Validator\Constraints as Assert;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * Filtres pour la sidebar et les pages landing SEO.
  7. * Un tag polymorphe (peut représenter une ville ou un métier) avec slug
  8. * pour générer une page dédiée /jobs/{slug}.
  9. *
  10. * @ORM\Table("cvs_jobsfilters")
  11. * @ORM\Entity(repositoryClass="App\Repository\Cvs\JobsFiltersRepository")
  12. * @ORM\HasLifecycleCallbacks()
  13. */
  14. class JobsFilters
  15. {
  16. /**
  17. * @var integer
  18. *
  19. * @ORM\Column(name="id", type="integer")
  20. * @ORM\Id
  21. * @ORM\GeneratedValue(strategy="AUTO")
  22. */
  23. protected $id;
  24. /**
  25. * @var \DateTimeInterface
  26. *
  27. * @ORM\Column(name="created_at", type="datetime", nullable=true, options={"comment":"Date de création"})
  28. */
  29. private $createdAt;
  30. /**
  31. * @var \DateTimeInterface
  32. *
  33. * @ORM\Column(name="updated_at", type="datetime", nullable=true, options={"comment":"Date de mise à jour"})
  34. */
  35. private $updatedAt;
  36. /**
  37. * Slug pour l'URL (ex: "paris", "developpement-web", "developpeur-symfony").
  38. *
  39. * @var string
  40. *
  41. * @ORM\Column(name="slug", type="string", length=255, nullable=true)
  42. * @Assert\NotBlank()
  43. */
  44. private $slug;
  45. /**
  46. * Label affiché dans la sidebar (ex: "Paris", "Développement Web").
  47. *
  48. * @var string
  49. *
  50. * @ORM\Column(name="label", type="string", length=255, nullable=true)
  51. * @Assert\NotBlank()
  52. */
  53. private $label;
  54. /**
  55. * Titre court pour SEO sur la page /jobs/{slug} (ex: "Offres d'emploi à Paris").
  56. *
  57. * @var string
  58. *
  59. * @ORM\Column(name="short_title", type="string", length=255, nullable=true)
  60. */
  61. private $shortTitle;
  62. /**
  63. * Description courte pour SEO sur la page /jobs/{slug}.
  64. *
  65. * @var string
  66. *
  67. * @ORM\Column(name="short_description", type="text", nullable=true)
  68. */
  69. private $shortDescription;
  70. /**
  71. * Mot-clé utilisé pour filtrer dans la table Jobs (matche city/category/jobTitle/requiredSkills).
  72. * Peut différer du label : label "Dév web" / searchKeyword "développement web".
  73. *
  74. * @var string
  75. *
  76. * @ORM\Column(name="search_keyword", type="string", length=255, nullable=true)
  77. */
  78. private $searchKeyword;
  79. /**
  80. * Icône/emoji facultative (ex: "📍" pour ville, "💻" pour métier).
  81. *
  82. * @var string
  83. *
  84. * @ORM\Column(name="icon", type="string", length=50, nullable=true)
  85. */
  86. private $icon;
  87. /**
  88. * Locale (fr, en).
  89. *
  90. * @var string
  91. *
  92. * @ORM\Column(name="locale", type="string", length=11, nullable=true)
  93. */
  94. private $locale;
  95. /**
  96. * Type indicatif (city, category, job, custom). Pas obligatoire — purement informatif
  97. * pour l'admin. Le comportement est polymorphe (tag générique).
  98. *
  99. * @var string
  100. *
  101. * @ORM\Column(name="type", type="string", length=50, nullable=true)
  102. */
  103. private $type;
  104. /**
  105. * Ordre d'affichage dans la sidebar.
  106. *
  107. * @var integer
  108. *
  109. * @ORM\Column(name="position", type="integer", nullable=true, options={"default":0})
  110. */
  111. private $position = 0;
  112. /**
  113. * Activé ou non.
  114. *
  115. * @var boolean
  116. *
  117. * @ORM\Column(name="online", type="boolean", nullable=true, options={"default":true})
  118. */
  119. private $online = true;
  120. public function __construct() {}
  121. /**
  122. * @ORM\PrePersist
  123. */
  124. public function setCreatedAtValue(): void
  125. {
  126. $this->setCreatedAt(new \DateTime("now"));
  127. $this->setUpdatedAt(new \DateTime("now"));
  128. }
  129. /**
  130. * @ORM\PreUpdate
  131. */
  132. public function setUpdatedAtValue(): void
  133. {
  134. $this->setUpdatedAt(new \DateTime("now"));
  135. }
  136. public function __toString()
  137. {
  138. return $this->label ?? (string) $this->id;
  139. }
  140. public function getId(): ?int { return $this->id; }
  141. public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; }
  142. public function setCreatedAt(?\DateTimeInterface $v): static { $this->createdAt = $v; return $this; }
  143. public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; }
  144. public function setUpdatedAt(?\DateTimeInterface $v): static { $this->updatedAt = $v; return $this; }
  145. public function getSlug(): ?string { return $this->slug; }
  146. public function setSlug(?string $v): static { $this->slug = $v; return $this; }
  147. public function getLabel(): ?string { return $this->label; }
  148. public function setLabel(?string $v): static { $this->label = $v; return $this; }
  149. public function getShortTitle(): ?string { return $this->shortTitle; }
  150. public function setShortTitle(?string $v): static { $this->shortTitle = $v; return $this; }
  151. public function getShortDescription(): ?string { return $this->shortDescription; }
  152. public function setShortDescription(?string $v): static { $this->shortDescription = $v; return $this; }
  153. public function getSearchKeyword(): ?string { return $this->searchKeyword; }
  154. public function setSearchKeyword(?string $v): static { $this->searchKeyword = $v; return $this; }
  155. public function getIcon(): ?string { return $this->icon; }
  156. public function setIcon(?string $v): static { $this->icon = $v; return $this; }
  157. public function getLocale(): ?string { return $this->locale; }
  158. public function setLocale(?string $v): static { $this->locale = $v; return $this; }
  159. public function getType(): ?string { return $this->type; }
  160. public function setType(?string $v): static { $this->type = $v; return $this; }
  161. public function getPosition(): ?int { return $this->position; }
  162. public function setPosition(?int $v): static { $this->position = $v; return $this; }
  163. public function getOnline(): ?bool { return $this->online; }
  164. public function setOnline(?bool $v): static { $this->online = $v; return $this; }
  165. }