<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table(name: 'crop_pest')]
#[ORM\Entity(repositoryClass: 'App\Entity\Repository\CropPestRepository')]
class CropPest
{
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;
#[ORM\Column(type: 'datetime', nullable: false)]
private $date_created;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Pest', inversedBy: 'cropPest')]
#[ORM\JoinColumn(name: 'pest_id', referencedColumnName: 'id', nullable: false)]
private $pest;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Crop', inversedBy: 'cropPest')]
#[ORM\JoinColumn(name: 'crop_id', referencedColumnName: 'id', nullable: false)]
private $crop;
public function getId(): ?int
{
return $this->id;
}
public function getDateCreated(): ?\DateTimeInterface
{
return $this->date_created;
}
public function setDateCreated(\DateTimeInterface $date_created): self
{
$this->date_created = $date_created;
return $this;
}
public function getPest(): ?Pest
{
return $this->pest;
}
public function setPest(?Pest $pest): self
{
$this->pest = $pest;
return $this;
}
public function getCrop(): ?Crop
{
return $this->crop;
}
public function setCrop(?Crop $crop): self
{
$this->crop = $crop;
return $this;
}
}