<?php
namespace App\Entity;
use App\Repository\CropPropertyRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CropPropertyRepository::class)]
class CropProperty
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: Crop::class, inversedBy: 'cropProperties')]
#[ORM\JoinColumn(nullable: false)]
private $crop;
#[ORM\Column(type: 'datetime')]
private $created_at;
#[ORM\Column(type: 'datetime', nullable: true)]
private $updated_at;
#[ORM\ManyToOne(targetEntity: Property::class, inversedBy: 'cropProperties')]
#[ORM\JoinColumn(nullable: false)]
private $property;
public function __construct()
{
$this->created_at = new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getCrop(): ?Crop
{
return $this->crop;
}
public function setCrop(?Crop $crop): self
{
$this->crop = $crop;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updated_at;
}
public function setUpdatedAt(?\DateTimeInterface $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
public function getProperty(): ?Property
{
return $this->property;
}
public function setProperty(?Property $property): self
{
$this->property = $property;
return $this;
}
}