<?phpnamespace App\Entity;use App\Repository\BlogRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;use Symfony\Component\Validator\Constraints as Assert;/** * @ORM\Entity(repositoryClass=BlogRepository::class) * @UniqueEntity("slug") */class Blog{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column */ private ?int $id = null; /** * @ORM\Column(length=255) */ private ?string $title = null; /** * @ORM\Column(length=255) */ private ?string $breadcrumb = null; public function getBreadcrumb(): ?string { return $this->breadcrumb; } public function setBreadcrumb(?string $breadcrumb): void { $this->breadcrumb = $breadcrumb; } /** * @ORM\Column(length=255, unique=true) * */ private ?string $slug = null; /** * @ORM\Column(length=255) */ private ?string $keywords = null; /** * @ORM\Column(length=255) */ private ?string $description = null; public function getRtTime(): ?int { return $this->rtTime; } public function setRtTime(?int $rtTime): void { $this->rtTime = $rtTime; } public function getView(): ?int { return $this->view; } public function setView(?int $view): void { $this->view = $view; } /** * @ORM\Column (type="integer") */ private ?int $rtTime = 0; /** * @ORM\Column (type="integer") */ private ?int $view = 0; /** * @ORM\Column(type="text") */ private ?string $content = null; /** * @ORM\Column */ private ?\DateTimeImmutable $created_at = null; /** * @ORM\Column(type="datetime_immutable", nullable=true) */ private $updated_at ; /** * @ORM\Column(length=255) * @Assert\NotBlank(message="Le champ titre ne peut pas ĂȘtre vide") */ private $bigtitle ; /** * @ORM\ManyToOne(targetEntity=PublicationImage::class) * @ORM\JoinColumn(name="blogimage_id", referencedColumnName="id", nullable=true) */ private ?PublicationImage $blogimage = null; /** * @ORM\ManyToMany(targetEntity=Thematique::class, inversedBy="blogs") */ private Collection $thematique; /** * @ORM\ManyToMany(targetEntity=SousThematique::class, inversedBy="blogs") */ private Collection $sous_thematique; public function __construct() { $this->thematique = new ArrayCollection(); $this->sous_thematique = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getTitle(): ?string { return $this->title; } public function setTitle(?string $title) { $this->title = $title; return $this; } public function getSlug(): ?string { return $this->slug; } public function setSlug(?string $slug) { $this->slug = $slug; return $this; } public function getKeywords(): ?string { return $this->keywords; } public function setKeywords(?string $keywords) { $this->keywords = $keywords; return $this; } public function getContent(): ?string { return $this->content; } public function setContent(?string $content) { $this->content = $content; return $this; } public function getCreatedAt(): ?\DateTimeImmutable { return $this->created_at; } public function setCreatedAt(\DateTimeImmutable $created_at) { $this->created_at = $created_at; return $this; } public function getUpdatedAt(): ?\DateTimeImmutable { return $this->updated_at; } public function setUpdatedAt(\DateTimeImmutable $updated_at) { $this->updated_at = $updated_at; return $this; } public function getBigtitle(): ?string { return $this->bigtitle; } public function setBigtitle(?string $bigtitle) { $this->bigtitle = $bigtitle; return $this; } public function getBlogimage(): ?PublicationImage { return $this->blogimage; } public function setBlogimage(?PublicationImage $blogimage) { $this->blogimage = $blogimage; return $this; } /** * @return Collection<int, Thematique> */ public function getThematique(): Collection { return $this->thematique; } public function addThematique(Thematique $thematique) { if (!$this->thematique->contains($thematique)) { $this->thematique->add($thematique); } return $this; } public function removeThematique(Thematique $thematique) { $this->thematique->removeElement($thematique); return $this; } /** * @return Collection<int, SousThematique> */ public function getSousThematique(): Collection { return $this->sous_thematique; } public function addSousThematique(SousThematique $sousThematique): static { if (!$this->sous_thematique->contains($sousThematique)) { $this->sous_thematique->add($sousThematique); } return $this; } public function removeSousThematique(SousThematique $sousThematique): static { $this->sous_thematique->removeElement($sousThematique); return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): void { $this->description = $description; }}