0])] private int $upVote = 0; #[ORM\Column(options: ["default" => 0])] private int $downVote = 0; #[ORM\ManyToOne(inversedBy: 'posts')] #[ORM\JoinColumn(nullable: false)] private ?Profil $profil = null; /** * @var Collection */ #[ORM\OneToMany(targetEntity: Commentary::class, mappedBy: 'post')] private Collection $commentaries; /** * @var Collection */ #[ORM\ManyToMany(targetEntity: Tags::class, inversedBy: 'posts')] private Collection $tags; public function __construct() { $this->commentaries = new ArrayCollection(); $this->tags = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getTitle(): ?string { return $this->title; } public function setTitle(?string $title): static { $this->title = $title; return $this; } public function getText(): ?string { return $this->text; } public function setText(?string $text): static { $this->text = $text; return $this; } public function isDream(): ?bool { return $this->isDream; } public function setDream(bool $isDream): static { $this->isDream = $isDream; return $this; } public function getDateCreated(): ?DateTime { return $this->dateCreated; } public function setDateCreated(?DateTime $dateCreated): static { $this->dateCreated = $dateCreated; return $this; } public function getUpVote(): ?int { return $this->upVote; } public function setUpVote(int $upVote): static { $this->upVote = $upVote; return $this; } public function getDownVote(): ?int { return $this->downVote; } public function setDownVote(int $downVote): static { $this->downVote = $downVote; return $this; } public function getProfil(): ?Profil { return $this->profil; } public function setProfil(?Profil $profil): static { $this->profil = $profil; return $this; } /** * @return Collection */ public function getCommentaries(): Collection { return $this->commentaries; } public function addCommentary(Commentary $commentary): static { if (!$this->commentaries->contains($commentary)) { $this->commentaries->add($commentary); $commentary->setPost($this); } return $this; } public function removeCommentary(Commentary $commentary): static { if ($this->commentaries->removeElement($commentary)) { // set the owning side to null (unless already changed) if ($commentary->getPost() === $this) { $commentary->setPost(null); } } return $this; } /** * @return Collection */ public function getTags(): Collection { return $this->tags; } public function addTag(Tags $tag): static { if (!$this->tags->contains($tag)) { $this->tags->add($tag); } return $this; } public function removeTag(Tags $tag): static { $this->tags->removeElement($tag); return $this; } }