src/Entity/Rating.php line 7

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. #[ORM\Table(name'rating')]
  5. #[ORM\Entity(repositoryClass'App\Entity\Repository\RatingRepository')]
  6. class Rating
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\Column(type'integer')]
  10.     #[ORM\GeneratedValue(strategy'AUTO')]
  11.     private $id;
  12.     #[ORM\Column(type'integer'nullabletrue)]
  13.     private $rating;
  14.     #[ORM\Column(type'text'nullabletrue)]
  15.     private $comment;
  16.     #[ORM\Column(type'datetime'nullabletrue)]
  17.     private $date_created;
  18.     #[ORM\ManyToOne(targetEntity'App\Entity\User'inversedBy'rating')]
  19.     #[ORM\JoinColumn(name'user_id'referencedColumnName'id'nullablefalse)]
  20.     private $user;
  21.     public function getId(): ?int
  22.     {
  23.         return $this->id;
  24.     }
  25.     public function getRating(): ?int
  26.     {
  27.         return $this->rating;
  28.     }
  29.     public function setRating(?int $rating): self
  30.     {
  31.         $this->rating $rating;
  32.         return $this;
  33.     }
  34.     public function getComment(): ?string
  35.     {
  36.         return $this->comment;
  37.     }
  38.     public function setComment(?string $comment): self
  39.     {
  40.         $this->comment $comment;
  41.         return $this;
  42.     }
  43.     public function getDateCreated(): ?\DateTimeInterface
  44.     {
  45.         return $this->date_created;
  46.     }
  47.     public function setDateCreated(?\DateTimeInterface $date_created): self
  48.     {
  49.         $this->date_created $date_created;
  50.         return $this;
  51.     }
  52.     public function getUser(): ?User
  53.     {
  54.         return $this->user;
  55.     }
  56.     public function setUser(?User $user): self
  57.     {
  58.         $this->user $user;
  59.         return $this;
  60.     }
  61. }