src/Entity/Transfer.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TransferRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use Gedmo\Timestampable\Traits\TimestampableEntity;
  9. #[ORM\Entity(repositoryClassTransferRepository::class)]
  10. class Transfer extends Product
  11. {
  12.     #[ORM\Column(length255)]
  13.    private ?string $name null;
  14.     #[ORM\Column]
  15.     private ?bool $active true;
  16.     #[ORM\OneToMany(mappedBy'transfer'targetEntityTransferAmenityPrice::class, orphanRemovaltrue)]
  17.     private Collection $transferAmenityPrices;
  18.     #[ORM\OneToMany(mappedBy'transfer'targetEntityVehiculeType::class, orphanRemovaltrue)]
  19.     private Collection $vehicules;
  20.     #[ORM\ManyToOne]
  21.     #[ORM\JoinColumn(nullablefalse)]
  22.     private ?Country $country null;
  23.     public function __construct()
  24.     {
  25.         parent::__construct();
  26.         $this->transferAmenityPrices = new ArrayCollection();
  27.         $this->vehicules = new ArrayCollection();
  28.     }
  29.     public function getName(): ?string
  30.     {
  31.         return $this->name;
  32.     }
  33.     public function setName(string $name): static
  34.     {
  35.         $this->name $name;
  36.         return $this;
  37.     }
  38.     public function isActive(): ?bool
  39.     {
  40.         return $this->active;
  41.     }
  42.     /**
  43.      * @return bool|null
  44.      */
  45.     public function getActive(): ?bool
  46.     {
  47.         return $this->active;
  48.     }
  49.     public function setActive(bool $active): static
  50.     {
  51.         $this->active $active;
  52.         return $this;
  53.     }
  54.     /**
  55.      * @return Collection<int, TransferAmenityPrice>
  56.      */
  57.     public function getTransferAmenityPrices(): Collection
  58.     {
  59.         return $this->transferAmenityPrices;
  60.     }
  61.     public function addTransferAmenityPrice(TransferAmenityPrice $transferAmenityPrice): static
  62.     {
  63.         if (!$this->transferAmenityPrices->contains($transferAmenityPrice)) {
  64.             $this->transferAmenityPrices->add($transferAmenityPrice);
  65.             $transferAmenityPrice->setTransfer($this);
  66.         }
  67.         return $this;
  68.     }
  69.     public function removeTransferAmenityPrice(TransferAmenityPrice $transferAmenityPrice): static
  70.     {
  71.         if ($this->transferAmenityPrices->removeElement($transferAmenityPrice)) {
  72.             // set the owning side to null (unless already changed)
  73.             if ($transferAmenityPrice->getTransfer() === $this) {
  74.                 $transferAmenityPrice->setTransfer(null);
  75.             }
  76.         }
  77.         return $this;
  78.     }
  79.     public function __toString(): string
  80.     {
  81.         return $this->name;
  82.     }
  83.     /**
  84.      * @return Collection<int, VehiculeType>
  85.      */
  86.     public function getVehicules(): Collection
  87.     {
  88.         return $this->vehicules;
  89.     }
  90.     public function addVehicule(VehiculeType $vehicule): static
  91.     {
  92.         if (!$this->vehicules->contains($vehicule)) {
  93.             $this->vehicules->add($vehicule);
  94.             $vehicule->setTransfer($this);
  95.         }
  96.         return $this;
  97.     }
  98.     public function removeVehicule(VehiculeType $vehicule): static
  99.     {
  100.         if ($this->vehicules->removeElement($vehicule)) {
  101.             // set the owning side to null (unless already changed)
  102.             if ($vehicule->getTransfer() === $this) {
  103.                 $vehicule->setTransfer(null);
  104.             }
  105.         }
  106.         return $this;
  107.     }
  108.     public function getCountry(): ?Country
  109.     {
  110.         return $this->country;
  111.     }
  112.     public function setCountry(?Country $country): static
  113.     {
  114.         $this->country $country;
  115.         return $this;
  116.     }
  117. }