<?php
namespace Aviatur\GeneralBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* City.
*
* @ORM\Table(name="city", indexes={@ORM\Index(name="IDX_8D69AD0AF92F3E70", columns={"country_id"})})
* @ORM\Entity(repositoryClass="Aviatur\GeneralBundle\Entity\CityRepository")
*/
class City
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="code", type="string", length=10, nullable=false)
*/
private $code;
/**
* @var string
*
* @ORM\Column(name="iataCode", type="string", length=10, nullable=false)
*/
private $iatacode;
/**
* @var string
*
* @ORM\Column(name="languageCode", type="string", length=10, nullable=false)
*/
private $languagecode;
/**
* @var string
*
* @ORM\Column(name="description", type="string", length=50, nullable=false)
*/
private $description;
/**
* @var string
*
* @ORM\Column(name="countryStateCode", type="string", length=10, nullable=false)
*/
private $countrystatecode;
/**
*
* @ORM\ManyToOne(targetEntity="Country", inversedBy="city")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="country_id", referencedColumnName="id")
* })
*/
private ?\Aviatur\GeneralBundle\Entity\Country $country = null;
/**
* @ORM\OneToMany(targetEntity="Aviatur\CustomerBundle\Entity\Customer", mappedBy="city", cascade={"all"})
*/
private $customer;
/**
* @ORM\OneToMany(targetEntity="Aviatur\FlightBundle\Entity\AdminFee", mappedBy="city", cascade={"all"})
*/
private $adminFee;
/**
* @ORM\OneToMany(targetEntity="Aviatur\FlightBundle\Entity\AdminFeeActivityLog", mappedBy="order", cascade={"all"})
*/
private $adminFeeActivityLog;
public function __toString()
{
$return = $this->getDescription().' ('.$this->getIatacode().')'.' - '.$this->getCountry();
return $return;
}
/**
* Constructor.
*/
public function __construct()
{
$this->adminFee = new \Doctrine\Common\Collections\ArrayCollection();
$this->customer = new \Doctrine\Common\Collections\ArrayCollection();
$this->adminFeeActivityLog = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set code.
*
* @param string $code
*
* @return City
*/
public function setCode($code)
{
$this->code = $code;
return $this;
}
/**
* Get code.
*
* @return string
*/
public function getCode()
{
return $this->code;
}
/**
* Set iatacode.
*
* @param string $iatacode
*
* @return City
*/
public function setIatacode($iatacode)
{
$this->iatacode = $iatacode;
return $this;
}
/**
* Get iatacode.
*
* @return string
*/
public function getIatacode()
{
return $this->iatacode;
}
/**
* Set languagecode.
*
* @param string $languagecode
*
* @return City
*/
public function setLanguagecode($languagecode)
{
$this->languagecode = $languagecode;
return $this;
}
/**
* Get languagecode.
*
* @return string
*/
public function getLanguagecode()
{
return $this->languagecode;
}
/**
* Set description.
*
* @param string $description
*
* @return City
*/
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
* Get description.
*
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* Set countrystatecode.
*
* @param string $countrystatecode
*
* @return City
*/
public function setCountrystatecode($countrystatecode)
{
$this->countrystatecode = $countrystatecode;
return $this;
}
/**
* Get countrystatecode.
*
* @return string
*/
public function getCountrystatecode()
{
return $this->countrystatecode;
}
/**
* Set country.
*
* @param \Aviatur\GeneralBundle\Entity\Country $country
*
* @return City
*/
public function setCountry(\Aviatur\GeneralBundle\Entity\Country $country = null)
{
$this->country = $country;
return $this;
}
/**
* Get country.
*
* @return \Aviatur\GeneralBundle\Entity\Country
*/
public function getCountry()
{
return $this->country;
}
/**
* Add customer.
*
* @return City
*/
public function addCustomer(\Aviatur\CustomerBundle\Entity\Customer $customer)
{
$this->customer[] = $customer;
return $this;
}
/**
* Remove customer.
*/
public function removeCustomer(\Aviatur\CustomerBundle\Entity\Customer $customer)
{
$this->customer->removeElement($customer);
}
/**
* Get customer.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getCustomer()
{
return $this->customer;
}
/**
* Remove adminFee.
*/
public function removeAdminFee(\Aviatur\FlightBundle\Entity\AdminFee $adminFee)
{
$this->adminFee->removeElement($adminFee);
}
/**
* Get adminFee.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getAdminFee()
{
return $this->adminFee;
}
/**
* Add adminFee.
*
* @return City
*/
public function addAdminFee(\Aviatur\FlightBundle\Entity\AdminFee $adminFee)
{
$this->adminFee[] = $adminFee;
return $this;
}
/**
* Add adminFeeActivityLog.
*
* @return AdminFeeActivityLog
*/
public function addAdminFeeActivityLog(\Aviatur\FlightBundle\Entity\AdminFeeActivityLog $adminFeeActivityLog)
{
$this->adminFeeActivityLog[] = $adminFeeActivityLog;
return $this;
}
/**
* Remove AdminFeeActivityLog.
*/
public function removeAdminFeeActivityLog(\Aviatur\FlightBundle\Entity\AdminFeeActivityLog $adminFeeActivityLog)
{
$this->adminFeeActivityLog->removeElement($adminFeeActivityLog);
}
/**
* Get AdminFeeActivityLog.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getAdminFeeActivityLog()
{
return $this->adminFeeActivityLog;
}
}