<?php
namespace App\Entity;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
class Comment
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private ?int $id = null;
#[ORM\Column(type: 'text')]
private ?string $content = null;
#[ORM\Column(length: 255,nullable: true)]
private ?string $userprofile = null;
#[ORM\Column(type: 'smallint')]
private ?int $rating = null; // Note entre 1 et 5
#[ORM\ManyToOne(targetEntity: Livreurs::class, inversedBy: 'comments')]
#[ORM\JoinColumn(nullable: false)]
private ?Livreurs $deliverer = null;
#[ORM\Column(type: 'datetime')]
private \DateTimeInterface $createdAt;
public function __construct()
{
$this->createdAt = new \DateTimeImmutable();
}
// Getters et setters...
public function getId(): ?int
{
return $this->id;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(string $content): static
{
$this->content = $content;
return $this;
}
public function getRating(): ?int
{
return $this->rating;
}
public function setRating(int $rating): static
{
$this->rating = $rating;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): static
{
$this->createdAt = $createdAt;
return $this;
}
public function getDeliverer(): ?Livreurs
{
return $this->deliverer;
}
public function setDeliverer(?Livreurs $deliverer): static
{
$this->deliverer = $deliverer;
return $this;
}
public function getUserprofile(): ?string
{
return $this->userprofile;
}
public function setUserprofile(?string $userprofile): static
{
$this->userprofile = $userprofile;
return $this;
}
}