<?php
namespace App\Entity;
use App\Repository\CommentsRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CommentsRepository::class)]
class Comments
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $author = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $comment = null;
#[ORM\Column(length: 255)]
private ?string $illustration = null;
#[ORM\Column]
private ?\DateTimeImmutable $createdAt = null;
#[ORM\ManyToOne(inversedBy: 'comments')]
private ?Product $activity = null;
#[ORM\Column]
private ?bool $isValid = false;
public function getId(): ?int
{
return $this->id;
}
public function __toString()
{
return $this->comment;
}
public function getAuthor(): ?string
{
return $this->author;
}
public function setAuthor(?string $author): self
{
$this->author = $author;
return $this;
}
public function getComment(): ?string
{
return $this->comment;
}
public function setComment(?string $comment): self
{
$this->comment = $comment;
return $this;
}
public function getIllustration(): ?string
{
return $this->illustration;
}
public function setIllustration(string $illustration): self
{
$this->illustration = $illustration;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeImmutable $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getActivity(): ?Product
{
return $this->activity;
}
public function setActivity(?Product $activity): self
{
$this->activity = $activity;
return $this;
}
public function isIsValid(): ?bool
{
return $this->isValid;
}
public function setIsValid(bool $isValid): self
{
$this->isValid = $isValid;
return $this;
}
}