<?php
namespace Aviatur\GeneralBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Country.
*
* @ORM\Table(name="country")
* @ORM\Entity(repositoryClass="Aviatur\GeneralBundle\Entity\CountryRepository")
*/
class Country
{
/**
* @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;
/**
* @ORM\OneToMany(targetEntity="Aviatur\CustomerBundle\Entity\Customer", mappedBy="country", cascade={"all"})
*/
private $customer;
/**
* @ORM\OneToMany(targetEntity="Aviatur\GeneralBundle\Entity\City", mappedBy="country", cascade={"all"})
*/
private $city;
/**
* @ORM\OneToMany(targetEntity="Aviatur\CruiserBundle\Entity\CruiserPortsGeolocalization", mappedBy="country", cascade={"all"})
*/
private $port;
public function __toString()
{
$return = $this->getDescription().' ('.$this->getIatacode().' - '.$this->getLanguagecode().')';
return $return;
}
/**
* Constructor.
*/
public function __construct()
{
$this->customer = new \Doctrine\Common\Collections\ArrayCollection();
$this->city = new \Doctrine\Common\Collections\ArrayCollection();
$this->port = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set code.
*
* @param string $code
*
* @return Country
*/
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 Country
*/
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 Country
*/
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 Country
*/
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
* Get description.
*
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* Add customer.
*
* @return Country
*/
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;
}
/**
* Add city.
*
* @return Country
*/
public function addCity(\Aviatur\GeneralBundle\Entity\City $city)
{
$this->city[] = $city;
return $this;
}
/**
* Remove city.
*/
public function removeCity(\Aviatur\GeneralBundle\Entity\City $city)
{
$this->city->removeElement($city);
}
/**
* Get city.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getCity()
{
return $this->city;
}
/**
* Add port.
*
* @return Country
*/
public function addPort(\Aviatur\CruiserBundle\Entity\CruiserPortsGeolocalization $port)
{
$this->port[] = $port;
return $this;
}
/**
* Remove port.
*/
public function removePort(\Aviatur\CruiserBundle\Entity\CruiserPortsGeolocalization $port)
{
$this->port->removeElement($port);
}
/**
* Get port.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPort()
{
return $this->port;
}
}