src/Entity/FavoriteCrop.php line 7

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