src/Entity/CropRating.php line 7

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. #[ORM\Table(name'crop_rating')]
  5. #[ORM\Entity(repositoryClass'App\Entity\Repository\CropRatingRepository')]
  6. class CropRating
  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\Crop'inversedBy'cropRating')]
  19.     #[ORM\JoinColumn(name'crop_id'referencedColumnName'id'nullablefalse)]
  20.     private $crop;
  21.     #[ORM\ManyToOne(targetEntity'App\Entity\User'inversedBy'cropRating')]
  22.     #[ORM\JoinColumn(name'user_id'referencedColumnName'id'nullablefalse)]
  23.     private $user;
  24.     public function getId(): ?int
  25.     {
  26.         return $this->id;
  27.     }
  28.     public function getRating(): ?int
  29.     {
  30.         return $this->rating;
  31.     }
  32.     public function setRating(?int $rating): self
  33.     {
  34.         $this->rating $rating;
  35.         return $this;
  36.     }
  37.     public function getComment(): ?string
  38.     {
  39.         return $this->comment;
  40.     }
  41.     public function setComment(?string $comment): self
  42.     {
  43.         $this->comment $comment;
  44.         return $this;
  45.     }
  46.     public function getDateCreated(): ?\DateTimeInterface
  47.     {
  48.         return $this->date_created;
  49.     }
  50.     public function setDateCreated(?\DateTimeInterface $date_created): self
  51.     {
  52.         $this->date_created $date_created;
  53.         return $this;
  54.     }
  55.     public function getCrop(): ?Crop
  56.     {
  57.         return $this->crop;
  58.     }
  59.     public function setCrop(?Crop $crop): self
  60.     {
  61.         $this->crop $crop;
  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. }