<?phpnamespace App\Entity\Articles;use Doctrine\DBAL\Types\Types;use Symfony\Component\Serializer\Annotation\Groups;use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;use Symfony\Component\Validator\Constraints as Assert;use Doctrine\ORM\Mapping as ORM;use Vich\UploaderBundle\Mapping\Annotation as Vich;use Symfony\Component\HttpFoundation\File\File;use App\Repository\Articles\ArticlesHasCategoriesRepository;use Symfony\Component\HttpFoundation\File\UploadedFile;use Vich\UploaderBundle\Entity\File as EmbeddedFile;/** * Articles * * @ORM\Table("articles_articles_has_categories") * @ORM\Entity(repositoryClass=ArticlesHasCategoriesRepository::class) * @ORM\HasLifecycleCallbacks() */class ArticlesHasCategories { /** * @var integer * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") * [Groups(['list', 'item'])] */ protected $id; /** * @var string * * @ORM\Column(name="created_at", type="datetime", nullable=true, options={"comment":"Date de création"}) */ private $createdAt; /** * @var string * * @ORM\Column(name="updated_at", type="datetime", nullable=true, options={"comment":"Date de mise à jour"}) */ private $updatedAt; /** * @var string * * @ORM\Column(name="title", type="string", length=500, nullable=true) */ private $title; /** * @var string * * @ORM\Column(name="titleMenu", type="string", length=500, nullable=true) */ private $titleMenu; /** * @var string * * @ORM\Column(name="titlePage", type="string", length=500, nullable=true) */ private $titlePage; /** * @var string * * @ORM\Column(name="identifiant", type="string", length=500, nullable=true) */ private $identifiant; /** * @var string * * @ORM\Column(name="slug", type="string", length=255, nullable=true) */ private $slug; /** * @var string * * @ORM\Column(name="shortTitle", type="string", length=500, nullable=true) */ private $shortTitle; /** * @var string * * @ORM\Column(name="short_description", type="text", nullable=true) */ private $shortDescription; /** * @var string * * @ORM\Column(name="top_description", type="text", nullable=true) */ private $topDescription; /** * @var string * * @ORM\Column(name="bottom_description", type="text", nullable=true) */ private $bottomDescription; /** * @var string * * @ORM\Column(name="locale", type="string", length=11, nullable=true) */ private $locale; /** * @var \ArticlesHasCategories * * @ORM\ManyToOne(targetEntity="ArticlesHasCategories") * @ORM\JoinColumns({ * @ORM\JoinColumn(name="category_id", referencedColumnName="id", nullable=true) * }) */ protected $category; /** * @var string * * @ORM\Column(name="parent", type="boolean", nullable=true) */ private $parent; /** * @var string * * @ORM\Column(name="recruiterDirectory", type="boolean", nullable=true) */ private $recruiterDirectory; /** * @var string * * @ORM\Column(name="employerDirectory", type="boolean", nullable=true) */ private $employerDirectory; /** * @ORM\PrePersist */ public function setCreatedAtValue(): void { $this->setCreatedAt(new \DateTime("now")); $this->setUpdatedAt(new \DateTime("now")); } /** * @ORM\PreUpdate */ public function setUpdatedAtValue(): void { $this->setUpdatedAt(new \DateTime("now")); } public function __toString() { $chain=""; if($this->recruiterDirectory == 1) { $chain="[Directory Recruiter] "; } if($this->parent == 1) { return $chain."PARENT: ".$this->title." (".$this->identifiant." • ".$this->locale.")"; } return $chain.$this->title." (".$this->identifiant." • ".$this->locale.")"; } public function getId(): ?int { return $this->id; } public function getCreatedAt(): ?\DateTimeInterface { return $this->createdAt; } public function setCreatedAt(?\DateTimeInterface $createdAt): static { $this->createdAt = $createdAt; return $this; } public function getUpdatedAt(): ?\DateTimeInterface { return $this->updatedAt; } public function setUpdatedAt(?\DateTimeInterface $updatedAt): static { $this->updatedAt = $updatedAt; return $this; } public function getTitle(): ?string { return $this->title; } public function setTitle(?string $title): static { $this->title = $title; return $this; } public function getIdentifiant(): ?string { return $this->identifiant; } public function setIdentifiant(?string $identifiant): static { $this->identifiant = $identifiant; return $this; } public function getSlug(): ?string { return $this->slug; } public function setSlug(?string $slug): static { $this->slug = $slug; return $this; } public function getShortTitle(): ?string { return $this->shortTitle; } public function setShortTitle(?string $shortTitle): static { $this->shortTitle = $shortTitle; return $this; } public function getShortDescription(): ?string { return $this->shortDescription; } public function setShortDescription(?string $shortDescription): static { $this->shortDescription = $shortDescription; return $this; } public function getLocale(): ?string { return $this->locale; } public function setLocale(?string $locale): static { $this->locale = $locale; return $this; } public function getCategory(): ?self { return $this->category; } public function setCategory(?self $category): static { $this->category = $category; return $this; } public function isParent(): ?bool { return $this->parent; } public function setParent(?bool $parent): static { $this->parent = $parent; return $this; } public function isRecruiterDirectory(): ?bool { return $this->recruiterDirectory; } public function setRecruiterDirectory(?bool $recruiterDirectory): static { $this->recruiterDirectory = $recruiterDirectory; return $this; } public function isEmployerDirectory(): ?bool { return $this->employerDirectory; } public function setEmployerDirectory(?bool $employerDirectory): static { $this->employerDirectory = $employerDirectory; return $this; } public function getTopDescription(): ?string { return $this->topDescription; } public function setTopDescription(?string $topDescription): static { $this->topDescription = $topDescription; return $this; } public function getBottomDescription(): ?string { return $this->bottomDescription; } public function setBottomDescription(?string $bottomDescription): static { $this->bottomDescription = $bottomDescription; return $this; } public function getTitleMenu(): ?string { return $this->titleMenu; } public function setTitleMenu(?string $titleMenu): static { $this->titleMenu = $titleMenu; return $this; } public function getTitlePage(): ?string { return $this->titlePage; } public function setTitlePage(?string $titlePage): static { $this->titlePage = $titlePage; return $this; }}