<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'crop_rating')]
#[ORM\Entity(repositoryClass: 'App\Entity\Repository\CropRatingRepository')]
class CropRating
{
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;
#[ORM\Column(type: 'integer', nullable: true)]
private $rating;
#[ORM\Column(type: 'text', nullable: true)]
private $comment;
#[ORM\Column(type: 'datetime', nullable: true)]
private $date_created;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Crop', inversedBy: 'cropRating')]
#[ORM\JoinColumn(name: 'crop_id', referencedColumnName: 'id', nullable: false)]
private $crop;
#[ORM\ManyToOne(targetEntity: 'App\Entity\User', inversedBy: 'cropRating')]
#[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', nullable: false)]
private $user;
public function getId(): ?int
{
return $this->id;
}
public function getRating(): ?int
{
return $this->rating;
}
public function setRating(?int $rating): self
{
$this->rating = $rating;
return $this;
}
public function getComment(): ?string
{
return $this->comment;
}
public function setComment(?string $comment): self
{
$this->comment = $comment;
return $this;
}
public function getDateCreated(): ?\DateTimeInterface
{
return $this->date_created;
}
public function setDateCreated(?\DateTimeInterface $date_created): self
{
$this->date_created = $date_created;
return $this;
}
public function getCrop(): ?Crop
{
return $this->crop;
}
public function setCrop(?Crop $crop): self
{
$this->crop = $crop;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
}