<?php
namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Blameable\Traits\BlameableEntity;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Knp\DoctrineBehaviors\Model\Translatable\TranslatableTrait;
use Knp\DoctrineBehaviors\Contract\Entity\TranslatableInterface;
use App\Repository\ReviewRepository;
#[ORM\Entity(repositoryClass: ReviewRepository::class)]
class Review implements TranslatableInterface
{
use BlameableEntity;
use TimestampableEntity;
use TranslatableTrait;
#[Assert\Valid]
protected $translations;
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne(inversedBy: 'reviews')]
#[Assert\NotNull()]
private ?User $user = null;
#[ORM\ManyToOne(inversedBy: 'reviews')]
private ?Product $product = null;
#[ORM\Column]
#[Assert\NotNull()]
#[Assert\Positive()]
private ?int $rating = null;
#[ORM\Column(nullable: true)]
private ?bool $visible = false;
public function __call($method, $arguments)
{
return $this->proxyCurrentLocaleTranslation($method, $arguments);
}
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(?Product $product): self
{
$this->product = $product;
return $this;
}
public function getRating(): ?int
{
return $this->rating;
}
public function setRating(int $rating): self
{
$this->rating = $rating;
return $this;
}
public function getVisible(): ?bool
{
return $this->visible;
}
public function setVisible(?bool $visible): self
{
$this->visible = $visible;
return $this;
}
}