<?phpnamespace App\Entity;use App\Repository\ArticlesRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ArticlesRepository::class)]class Articles{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255)] private ?string $Title = null; #[ORM\Column(type: Types::TEXT)] private ?string $Article = null; #[ORM\ManyToOne(inversedBy: 'articles')] private ?User $User = null; #[ORM\OneToMany(mappedBy: 'article', targetEntity: Comments::class)] private Collection $comments; #[ORM\Column(type: Types::DATETIME_MUTABLE)] private ?\DateTimeInterface $date = null; public function __construct() { $this->comments = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getTitle(): ?string { return $this->Title; } public function setTitle(string $Title): self { $this->Title = $Title; return $this; } public function getArticle(): ?string { return $this->Article; } public function setArticle(string $Article): self { $this->Article = $Article; return $this; } public function getUser(): ?User { return $this->User; } public function setUser(?User $User): self { $this->User = $User; return $this; } /** * @return Collection<int, Comments> */ public function getComments(): Collection { return $this->comments; } public function addComment(Comments $comment): self { if (!$this->comments->contains($comment)) { $this->comments->add($comment); $comment->setArticle($this); } return $this; } public function removeComment(Comments $comment): self { if ($this->comments->removeElement($comment)) { // set the owning side to null (unless already changed) if ($comment->getArticle() === $this) { $comment->setArticle(null); } } return $this; } public function getDate(): ?\DateTimeInterface { return $this->date; } public function setDate(\DateTimeInterface $date): self { $this->date = $date; return $this; }}