<?php
namespace App\Entity;
use App\Entity\Airline\Tariff;
use App\Entity\Documentation\HouseGuide;
use App\Entity\Documentation\MasterGuide;
use App\Entity\Documentation\MasterGuideNumber;
use App\Repository\AirlineRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=AirlineRepository::class)
*/
class Airline
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="text")
*/
private $address;
/**
* @ORM\Column(type="string", length=255)
*/
private $rfc;
/**
* @ORM\Column(type="string", length=255)
*/
private $contactName;
/**
* @ORM\Column(type="string", length=255)
*/
private $contactPhone;
/**
* @ORM\Column(type="boolean")
*/
private $isIATA;
/**
* @ORM\Column(type="boolean")
*/
private $enabled;
/**
* @ORM\OneToMany(targetEntity=HouseGuide::class, mappedBy="airline")
*/
private $houseGuides;
/**
* @ORM\Column(type="string", length=255)
*/
private $iataCode;
/**
* @ORM\OneToMany(targetEntity=MasterGuideNumber::class, mappedBy="airline")
*/
private $masterGuideNumbers;
/**
* @ORM\OneToMany(targetEntity=Tariff::class, mappedBy="airline")
*/
private $tariffs;
/**
* @ORM\OneToMany(targetEntity=MasterGuide::class, mappedBy="airline")
*/
private $masterGuides;
public function __construct()
{
$this->houseGuides = new ArrayCollection();
$this->masterGuideNumbers = new ArrayCollection();
$this->tariffs = new ArrayCollection();
$this->masterGuides = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(string $address): self
{
$this->address = $address;
return $this;
}
public function getRfc(): ?string
{
return $this->rfc;
}
public function setRfc(string $rfc): self
{
$this->rfc = $rfc;
return $this;
}
public function getContactName(): ?string
{
return $this->contactName;
}
public function setContactName(string $contactName): self
{
$this->contactName = $contactName;
return $this;
}
public function getContactPhone(): ?string
{
return $this->contactPhone;
}
public function setContactPhone(string $contactPhone): self
{
$this->contactPhone = $contactPhone;
return $this;
}
public function isIsIATA(): ?bool
{
return $this->isIATA;
}
public function setIsIATA(bool $isIATA): self
{
$this->isIATA = $isIATA;
return $this;
}
public function isEnabled(): ?bool
{
return $this->enabled;
}
public function setEnabled(bool $enabled): self
{
$this->enabled = $enabled;
return $this;
}
/**
* @return Collection<int, HouseGuide>
*/
public function getHouseGuides(): Collection
{
return $this->houseGuides;
}
public function addHouseGuide(HouseGuide $houseGuide): self
{
if (!$this->houseGuides->contains($houseGuide)) {
$this->houseGuides[] = $houseGuide;
$houseGuide->setAirline($this);
}
return $this;
}
public function removeHouseGuide(HouseGuide $houseGuide): self
{
if ($this->houseGuides->removeElement($houseGuide)) {
// set the owning side to null (unless already changed)
if ($houseGuide->getAirline() === $this) {
$houseGuide->setAirline(null);
}
}
return $this;
}
public function getIataCode(): ?string
{
return $this->iataCode;
}
public function setIataCode(string $iataCode): self
{
$this->iataCode = $iataCode;
return $this;
}
/**
* @return Collection<int, MasterGuideNumber>
*/
public function getMasterGuideNumbers(): Collection
{
return $this->masterGuideNumbers;
}
public function addMasterGuideNumber(MasterGuideNumber $masterGuideNumber): self
{
if (!$this->masterGuideNumbers->contains($masterGuideNumber)) {
$this->masterGuideNumbers[] = $masterGuideNumber;
$masterGuideNumber->setAirline($this);
}
return $this;
}
public function removeMasterGuideNumber(MasterGuideNumber $masterGuideNumber): self
{
if ($this->masterGuideNumbers->removeElement($masterGuideNumber)) {
// set the owning side to null (unless already changed)
if ($masterGuideNumber->getAirline() === $this) {
$masterGuideNumber->setAirline(null);
}
}
return $this;
}
public function __toString()
{
return $this->name;
}
/**
* @return Collection<int, Tariff>
*/
public function getTariffs(): Collection
{
return $this->tariffs;
}
public function addTariff(Tariff $tariff): self
{
if (!$this->tariffs->contains($tariff)) {
$this->tariffs[] = $tariff;
$tariff->setAirline($this);
}
return $this;
}
public function removeTariff(Tariff $tariff): self
{
if ($this->tariffs->removeElement($tariff)) {
// set the owning side to null (unless already changed)
if ($tariff->getAirline() === $this) {
$tariff->setAirline(null);
}
}
return $this;
}
/**
* @return Collection<int, MasterGuide>
*/
public function getMasterGuides(): Collection
{
return $this->masterGuides;
}
public function addMasterGuide(MasterGuide $masterGuide): self
{
if (!$this->masterGuides->contains($masterGuide)) {
$this->masterGuides[] = $masterGuide;
$masterGuide->setAirline($this);
}
return $this;
}
public function removeMasterGuide(MasterGuide $masterGuide): self
{
if ($this->masterGuides->removeElement($masterGuide)) {
// set the owning side to null (unless already changed)
if ($masterGuide->getAirline() === $this) {
$masterGuide->setAirline(null);
}
}
return $this;
}
}