src/Entity/Cvs/EnterprisesFilters.php line 21

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