src/Entity/CropProperty.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CropPropertyRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassCropPropertyRepository::class)]
  6. class CropProperty
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\ManyToOne(targetEntityCrop::class, inversedBy'cropProperties')]
  13.     #[ORM\JoinColumn(nullablefalse)]
  14.     private $crop;
  15.     #[ORM\Column(type'datetime')]
  16.     private $created_at;
  17.     #[ORM\Column(type'datetime'nullabletrue)]
  18.     private $updated_at;
  19.     #[ORM\ManyToOne(targetEntityProperty::class, inversedBy'cropProperties')]
  20.     #[ORM\JoinColumn(nullablefalse)]
  21.     private $property;
  22.     public function __construct()
  23.     {
  24.         $this->created_at = new \DateTime();
  25.     }
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getCrop(): ?Crop
  31.     {
  32.         return $this->crop;
  33.     }
  34.     public function setCrop(?Crop $crop): self
  35.     {
  36.         $this->crop $crop;
  37.         return $this;
  38.     }
  39.     public function getCreatedAt(): ?\DateTimeInterface
  40.     {
  41.         return $this->created_at;
  42.     }
  43.     public function setCreatedAt(\DateTimeInterface $created_at): self
  44.     {
  45.         $this->created_at $created_at;
  46.         return $this;
  47.     }
  48.     public function getUpdatedAt(): ?\DateTimeInterface
  49.     {
  50.         return $this->updated_at;
  51.     }
  52.     public function setUpdatedAt(?\DateTimeInterface $updated_at): self
  53.     {
  54.         $this->updated_at $updated_at;
  55.         return $this;
  56.     }
  57.     public function getProperty(): ?Property
  58.     {
  59.         return $this->property;
  60.     }
  61.     public function setProperty(?Property $property): self
  62.     {
  63.         $this->property $property;
  64.         return $this;
  65.     }
  66. }