src/Entity/ReviewsProduct.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ReviewsProductRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=ReviewsProductRepository::class)
  7.  */
  8. class ReviewsProduct
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $note;
  20.     /**
  21.      * @ORM\Column(type="text", nullable=true)
  22.      */
  23.     private $comment;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="reviewsProducts")
  26.      * @ORM\JoinColumn(nullable=false)
  27.      */
  28.     private $user;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity=Product::class, inversedBy="reviewsProducts")
  31.      * @ORM\JoinColumn(nullable=false)
  32.      */
  33.     private $product;
  34.     /**
  35.      * @ORM\Column(type="datetime")
  36.      */
  37.     private $createdAt;
  38.     public function __construct()
  39.     {
  40.         $this->createdAt = new \DateTime();
  41.     }
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getNote(): ?int
  47.     {
  48.         return $this->note;
  49.     }
  50.     public function setNote(int $note): self
  51.     {
  52.         $this->note $note;
  53.         return $this;
  54.     }
  55.     public function getComment(): ?string
  56.     {
  57.         return $this->comment;
  58.     }
  59.     public function setComment(?string $comment): self
  60.     {
  61.         $this->comment $comment;
  62.         return $this;
  63.     }
  64.     public function getUser(): ?User
  65.     {
  66.         return $this->user;
  67.     }
  68.     public function setUser(?User $user): self
  69.     {
  70.         $this->user $user;
  71.         return $this;
  72.     }
  73.     public function getProduct(): ?Product
  74.     {
  75.         return $this->product;
  76.     }
  77.     public function setProduct(?Product $product): self
  78.     {
  79.         $this->product $product;
  80.         return $this;
  81.     }
  82.     public function getCreatedAt(): ?\DateTimeInterface
  83.     {
  84.         return $this->createdAt;
  85.     }
  86.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  87.     {
  88.         $this->createdAt $createdAt;
  89.         return $this;
  90.     }
  91. }