<?phpnamespace App\Entity;use App\Repository\VehiculeTypeRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Symfony\Component\Validator\Constraints as Assert;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: VehiculeTypeRepository::class)]class VehiculeType extends ProductElement{ #[Assert\NotBlank] #[ORM\Column(length: 128)] private ?string $name = null; #[Assert\NotBlank] #[ORM\Column(length: 255)] private ?string $description = null; #[ORM\Column] #[Assert\Type(type: 'integer')] #[Assert\NotNull] private ?int $capacityMaxPax; #[ORM\Column] #[Assert\Type(type: 'integer')] #[Assert\NotNull] private ?int $capacityMaxBaggage; #[ORM\Column(nullable: true)] #[Assert\GreaterThan(0)] private ?float $priceBase = null; #[ORM\Column(nullable: true)] #[Assert\GreaterThanOrEqual(0)] private ?float $priceKm = null; #[ORM\Column(nullable: true)] #[Assert\GreaterThanOrEqual(0)] private ?float $priceHour = null; #[ORM\OneToOne(cascade: ['persist', 'remove'])] private ?FileData $image = null; #[ORM\ManyToOne(inversedBy: 'vehicules')] #[ORM\JoinColumn(nullable: false)] private ?Transfer $transfer = null; #[ORM\Column(length: 16)] private ?string $pricingStrategy = null; #[ORM\Column(nullable: true)] private ?float $priceMin = null; #[ORM\Column(nullable: true)] private ?float $priceMax = null; #[ORM\Column(nullable: true)] private ?float $priceNightMultiplier = null; #[ORM\Column(nullable: true)] private ?float $priceNightFee = null; #[ORM\OneToMany(mappedBy: 'vehicule', targetEntity: VehiculeTypePricing::class, cascade: ['persist'], orphanRemoval: true)] private Collection $pricings; #[ORM\Column] private ?bool $active = false; public function __construct() { parent::__construct(); $this->pricings = new ArrayCollection(); } public function getName(): ?string { return $this->name; } public function setName(?string $name): static { $this->name = $name; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): static { $this->description = $description; return $this; } public function getCapacityMaxPax(): ?int { return $this->capacityMaxPax; } public function setCapacityMaxPax(?int $capacityMaxPax): static { $this->capacityMaxPax = $capacityMaxPax; return $this; } public function getCapacityMaxBaggage(): ?int { return $this->capacityMaxBaggage; } public function setCapacityMaxBaggage(?int $capacityMaxBaggage): static { $this->capacityMaxBaggage = $capacityMaxBaggage; return $this; } public function __toString(): string { return $this->name; } public function getImage(): ?FileData { return $this->image; } public function setImage(?FileData $image): static { $this->image = $image; return $this; } public function getPriceBase(): ?float { return $this->priceBase; } public function setPriceBase(float $priceBase): static { $this->priceBase = $priceBase; return $this; } public function getPriceKm(): ?float { return $this->priceKm; } public function setPriceKm(float $priceKm): static { $this->priceKm = $priceKm; return $this; } public function getPriceHour(): ?float { return $this->priceHour; } public function setPriceHour(float $priceHour): static { $this->priceHour = $priceHour; return $this; } public function getTransfer(): ?Transfer { return $this->transfer; } public function setTransfer(?Transfer $transfer): static { $this->transfer = $transfer; return $this; } public function getPricingStrategy(): ?string { return $this->pricingStrategy; } public function setPricingStrategy(string $pricingStrategy): static { $this->pricingStrategy = $pricingStrategy; return $this; } public function getPriceMin(): ?float { return $this->priceMin; } public function setPriceMin(?float $priceMin): static { $this->priceMin = $priceMin; return $this; } public function getPriceMax(): ?float { return $this->priceMax; } public function setPriceMax(?float $priceMax): static { $this->priceMax = $priceMax; return $this; } public function getPriceNightMultiplier(): ?float { return $this->priceNightMultiplier; } public function setPriceNightMultiplier(?float $priceNightMultiplier): static { $this->priceNightMultiplier = $priceNightMultiplier; return $this; } public function getPriceNightFee(): ?float { return $this->priceNightFee; } public function setPriceNightFee(?float $priceNightFee): static { $this->priceNightFee = $priceNightFee; return $this; } /** * @return Collection<int, VehiculeTypePricing> */ public function getPricings(): Collection { return $this->pricings; } public function addPricing(VehiculeTypePricing $vehiculeTypePricing): static { if (!$this->pricings->contains($vehiculeTypePricing)) { $this->pricings->add($vehiculeTypePricing); $vehiculeTypePricing->setVehicule($this); } return $this; } public function removePricing(VehiculeTypePricing $vehiculeTypePricing): static { if ($this->pricings->removeElement($vehiculeTypePricing)) { // set the owning side to null (unless already changed) if ($vehiculeTypePricing->getVehicule() === $this) { $vehiculeTypePricing->setVehicule(null); } } return $this; } public function isActive(): ?bool { return $this->active; } public function setActive(bool $active): static { $this->active = $active; return $this; }}