Files
symfony-k3s/src/Entity/WeatherForecast.php
T

66 lines
2.9 KiB
PHP

<?php
namespace App\Entity;
use App\Repository\WeatherForecastRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: WeatherForecastRepository::class)]
#[ORM\UniqueConstraint(name: 'weather_forecast_settings_day', fields: ['settings', 'forecastDate'])]
class WeatherForecast
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
private ?Settings $settings = null;
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
private ?\DateTimeImmutable $forecastDate = null;
#[ORM\Column(nullable: true)]
private ?float $temperatureMax = null;
#[ORM\Column(nullable: true)]
private ?float $temperatureMin = null;
#[ORM\Column(nullable: true)]
private ?float $precipitationSum = null;
#[ORM\Column(nullable: true)]
private ?int $precipitationProbabilityMax = null;
#[ORM\Column(nullable: true)]
private ?float $rainSum = null;
#[ORM\Column(nullable: true)]
private ?int $weatherCode = null;
#[ORM\Column]
private ?\DateTimeImmutable $fetchedAt = null;
public function getId(): ?int { return $this->id; }
public function getSettings(): ?Settings { return $this->settings; }
public function setSettings(Settings $settings): static { $this->settings = $settings; return $this; }
public function getForecastDate(): ?\DateTimeImmutable { return $this->forecastDate; }
public function setForecastDate(\DateTimeImmutable $date): static { $this->forecastDate = $date->setTime(0, 0); return $this; }
public function getTemperatureMax(): ?float { return $this->temperatureMax; }
public function setTemperatureMax(?float $value): static { $this->temperatureMax = $value; return $this; }
public function getTemperatureMin(): ?float { return $this->temperatureMin; }
public function setTemperatureMin(?float $value): static { $this->temperatureMin = $value; return $this; }
public function getPrecipitationSum(): ?float { return $this->precipitationSum; }
public function setPrecipitationSum(?float $value): static { $this->precipitationSum = $value; return $this; }
public function getPrecipitationProbabilityMax(): ?int { return $this->precipitationProbabilityMax; }
public function setPrecipitationProbabilityMax(?int $value): static { $this->precipitationProbabilityMax = $value; return $this; }
public function getRainSum(): ?float { return $this->rainSum; }
public function setRainSum(?float $value): static { $this->rainSum = $value; return $this; }
public function getWeatherCode(): ?int { return $this->weatherCode; }
public function setWeatherCode(?int $value): static { $this->weatherCode = $value; return $this; }
public function getFetchedAt(): ?\DateTimeImmutable { return $this->fetchedAt; }
public function setFetchedAt(\DateTimeImmutable $fetchedAt): static { $this->fetchedAt = $fetchedAt; return $this; }
}