src/Entity/CropPest.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_pest')]
  5. #[ORM\Entity(repositoryClass'App\Entity\Repository\CropPestRepository')]
  6. class CropPest
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\Column(type'integer')]
  10.     #[ORM\GeneratedValue(strategy'AUTO')]
  11.     private $id;
  12.     #[ORM\Column(type'datetime'nullablefalse)]
  13.     private $date_created;
  14.     #[ORM\ManyToOne(targetEntity'App\Entity\Pest'inversedBy'cropPest')]
  15.     #[ORM\JoinColumn(name'pest_id'referencedColumnName'id'nullablefalse)]
  16.     private $pest;
  17.     #[ORM\ManyToOne(targetEntity'App\Entity\Crop'inversedBy'cropPest')]
  18.     #[ORM\JoinColumn(name'crop_id'referencedColumnName'id'nullablefalse)]
  19.     private $crop;
  20.     public function getId(): ?int
  21.     {
  22.         return $this->id;
  23.     }
  24.     public function getDateCreated(): ?\DateTimeInterface
  25.     {
  26.         return $this->date_created;
  27.     }
  28.     public function setDateCreated(\DateTimeInterface $date_created): self
  29.     {
  30.         $this->date_created $date_created;
  31.         return $this;
  32.     }
  33.     public function getPest(): ?Pest
  34.     {
  35.         return $this->pest;
  36.     }
  37.     public function setPest(?Pest $pest): self
  38.     {
  39.         $this->pest $pest;
  40.         return $this;
  41.     }
  42.     public function getCrop(): ?Crop
  43.     {
  44.         return $this->crop;
  45.     }
  46.     public function setCrop(?Crop $crop): self
  47.     {
  48.         $this->crop $crop;
  49.         return $this;
  50.     }
  51. }