src/Entity/Climatezone.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ClimatezoneRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassClimatezoneRepository::class)]
  9. class Climatezone
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length50)]
  16.     private ?string $name null;
  17.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  18.     private ?string $description null;
  19.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  20.     private ?\DateTimeInterface $first_frost_at null;
  21.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  22.     private ?\DateTimeInterface $last_frost_at null;
  23.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  24.     private ?\DateTimeInterface $created_at null;
  25.     #[ORM\OneToMany(mappedBy'climatezone'targetEntityClimatezoneRaster::class)]
  26.     private Collection $climatezoneRasters;
  27.     #[ORM\Column(nullabletrue)]
  28.     private ?float $min_winter_temperature null;
  29.     #[ORM\Column(nullabletrue)]
  30.     private ?float $max_winter_temperature null;
  31.     public function __construct()
  32.     {
  33.         $this->climatezoneRasters = new ArrayCollection();
  34.         $this->created_at = new \DateTime();
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getName(): ?string
  41.     {
  42.         return $this->name;
  43.     }
  44.     public function setName(string $name): static
  45.     {
  46.         $this->name $name;
  47.         return $this;
  48.     }
  49.     public function getDescription(): ?string
  50.     {
  51.         return $this->description;
  52.     }
  53.     public function setDescription(?string $description): static
  54.     {
  55.         $this->description $description;
  56.         return $this;
  57.     }
  58.     public function getFirstFrostAt(): ?\DateTimeInterface
  59.     {
  60.         return $this->first_frost_at;
  61.     }
  62.     public function setFirstFrostAt(\DateTimeInterface $first_frost_at): static
  63.     {
  64.         $this->first_frost_at $first_frost_at;
  65.         return $this;
  66.     }
  67.     public function getLastFrostAt(): ?\DateTimeInterface
  68.     {
  69.         return $this->last_frost_at;
  70.     }
  71.     public function setLastFrostAt(\DateTimeInterface $last_frost_at): static
  72.     {
  73.         $this->last_frost_at $last_frost_at;
  74.         return $this;
  75.     }
  76.     public function getCreatedAt(): ?\DateTimeInterface
  77.     {
  78.         return $this->created_at;
  79.     }
  80.     public function setCreatedAt(\DateTimeInterface $created_at): static
  81.     {
  82.         $this->created_at $created_at;
  83.         return $this;
  84.     }
  85.     /**
  86.      * @return Collection<int, ClimatezoneRaster>
  87.      */
  88.     public function getClimatezoneRasters(): Collection
  89.     {
  90.         return $this->climatezoneRasters;
  91.     }
  92.     public function addClimatezoneRaster(ClimatezoneRaster $climatezoneRaster): static
  93.     {
  94.         if (!$this->climatezoneRasters->contains($climatezoneRaster)) {
  95.             $this->climatezoneRasters->add($climatezoneRaster);
  96.             $climatezoneRaster->setClimatezone($this);
  97.         }
  98.         return $this;
  99.     }
  100.     public function removeClimatezoneRaster(ClimatezoneRaster $climatezoneRaster): static
  101.     {
  102.         if ($this->climatezoneRasters->removeElement($climatezoneRaster)) {
  103.             // set the owning side to null (unless already changed)
  104.             if ($climatezoneRaster->getClimatezone() === $this) {
  105.                 $climatezoneRaster->setClimatezone(null);
  106.             }
  107.         }
  108.         return $this;
  109.     }
  110.     public function getMinWinterTemperature(): ?float
  111.     {
  112.         return $this->min_winter_temperature;
  113.     }
  114.     public function setMinWinterTemperature(?float $min_winter_temperature): static
  115.     {
  116.         $this->min_winter_temperature $min_winter_temperature;
  117.         return $this;
  118.     }
  119.     public function getMaxWinterTemperature(): ?float
  120.     {
  121.         return $this->max_winter_temperature;
  122.     }
  123.     public function setMaxWinterTemperature(?float $max_winter_temperature): static
  124.     {
  125.         $this->max_winter_temperature $max_winter_temperature;
  126.         return $this;
  127.     }
  128. }