src/Aviatur/GeneralBundle/Entity/Country.php line 13

Open in your IDE?
  1. <?php
  2. namespace Aviatur\GeneralBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * Country.
  6.  *
  7.  * @ORM\Table(name="country")
  8.  * @ORM\Entity(repositoryClass="Aviatur\GeneralBundle\Entity\CountryRepository")
  9.  */
  10. class Country
  11. {
  12.     /**
  13.      * @var int
  14.      *
  15.      * @ORM\Column(name="id", type="integer", nullable=false)
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue(strategy="IDENTITY")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @var string
  22.      *
  23.      * @ORM\Column(name="code", type="string", length=10, nullable=false)
  24.      */
  25.     private $code;
  26.     /**
  27.      * @var string
  28.      *
  29.      * @ORM\Column(name="iataCode", type="string", length=10, nullable=false)
  30.      */
  31.     private $iatacode;
  32.     /**
  33.      * @var string
  34.      *
  35.      * @ORM\Column(name="languageCode", type="string", length=10, nullable=false)
  36.      */
  37.     private $languagecode;
  38.     /**
  39.      * @var string
  40.      *
  41.      * @ORM\Column(name="description", type="string", length=50, nullable=false)
  42.      */
  43.     private $description;
  44.     /**
  45.      * @ORM\OneToMany(targetEntity="Aviatur\CustomerBundle\Entity\Customer", mappedBy="country", cascade={"all"})
  46.      */
  47.     private $customer;
  48.     /**
  49.      * @ORM\OneToMany(targetEntity="Aviatur\GeneralBundle\Entity\City", mappedBy="country", cascade={"all"})
  50.      */
  51.     private $city;
  52.     /**
  53.      * @ORM\OneToMany(targetEntity="Aviatur\CruiserBundle\Entity\CruiserPortsGeolocalization", mappedBy="country", cascade={"all"})
  54.      */
  55.     private $port;
  56.     public function __toString()
  57.     {
  58.         $return $this->getDescription().' ('.$this->getIatacode().' - '.$this->getLanguagecode().')';
  59.         return $return;
  60.     }
  61.     /**
  62.      * Constructor.
  63.      */
  64.     public function __construct()
  65.     {
  66.         $this->customer = new \Doctrine\Common\Collections\ArrayCollection();
  67.         $this->city = new \Doctrine\Common\Collections\ArrayCollection();
  68.         $this->port = new \Doctrine\Common\Collections\ArrayCollection();
  69.     }
  70.     /**
  71.      * Get id.
  72.      *
  73.      * @return int
  74.      */
  75.     public function getId()
  76.     {
  77.         return $this->id;
  78.     }
  79.     /**
  80.      * Set code.
  81.      *
  82.      * @param string $code
  83.      *
  84.      * @return Country
  85.      */
  86.     public function setCode($code)
  87.     {
  88.         $this->code $code;
  89.         return $this;
  90.     }
  91.     /**
  92.      * Get code.
  93.      *
  94.      * @return string
  95.      */
  96.     public function getCode()
  97.     {
  98.         return $this->code;
  99.     }
  100.     /**
  101.      * Set iatacode.
  102.      *
  103.      * @param string $iatacode
  104.      *
  105.      * @return Country
  106.      */
  107.     public function setIatacode($iatacode)
  108.     {
  109.         $this->iatacode $iatacode;
  110.         return $this;
  111.     }
  112.     /**
  113.      * Get iatacode.
  114.      *
  115.      * @return string
  116.      */
  117.     public function getIatacode()
  118.     {
  119.         return $this->iatacode;
  120.     }
  121.     /**
  122.      * Set languagecode.
  123.      *
  124.      * @param string $languagecode
  125.      *
  126.      * @return Country
  127.      */
  128.     public function setLanguagecode($languagecode)
  129.     {
  130.         $this->languagecode $languagecode;
  131.         return $this;
  132.     }
  133.     /**
  134.      * Get languagecode.
  135.      *
  136.      * @return string
  137.      */
  138.     public function getLanguagecode()
  139.     {
  140.         return $this->languagecode;
  141.     }
  142.     /**
  143.      * Set description.
  144.      *
  145.      * @param string $description
  146.      *
  147.      * @return Country
  148.      */
  149.     public function setDescription($description)
  150.     {
  151.         $this->description $description;
  152.         return $this;
  153.     }
  154.     /**
  155.      * Get description.
  156.      *
  157.      * @return string
  158.      */
  159.     public function getDescription()
  160.     {
  161.         return $this->description;
  162.     }
  163.     /**
  164.      * Add customer.
  165.      *
  166.      * @return Country
  167.      */
  168.     public function addCustomer(\Aviatur\CustomerBundle\Entity\Customer $customer)
  169.     {
  170.         $this->customer[] = $customer;
  171.         return $this;
  172.     }
  173.     /**
  174.      * Remove customer.
  175.      */
  176.     public function removeCustomer(\Aviatur\CustomerBundle\Entity\Customer $customer)
  177.     {
  178.         $this->customer->removeElement($customer);
  179.     }
  180.     /**
  181.      * Get customer.
  182.      *
  183.      * @return \Doctrine\Common\Collections\Collection
  184.      */
  185.     public function getCustomer()
  186.     {
  187.         return $this->customer;
  188.     }
  189.     /**
  190.      * Add city.
  191.      *
  192.      * @return Country
  193.      */
  194.     public function addCity(\Aviatur\GeneralBundle\Entity\City $city)
  195.     {
  196.         $this->city[] = $city;
  197.         return $this;
  198.     }
  199.     /**
  200.      * Remove city.
  201.      */
  202.     public function removeCity(\Aviatur\GeneralBundle\Entity\City $city)
  203.     {
  204.         $this->city->removeElement($city);
  205.     }
  206.     /**
  207.      * Get city.
  208.      *
  209.      * @return \Doctrine\Common\Collections\Collection
  210.      */
  211.     public function getCity()
  212.     {
  213.         return $this->city;
  214.     }
  215.     /**
  216.      * Add port.
  217.      *
  218.      * @return Country
  219.      */
  220.     public function addPort(\Aviatur\CruiserBundle\Entity\CruiserPortsGeolocalization $port)
  221.     {
  222.         $this->port[] = $port;
  223.         return $this;
  224.     }
  225.     /**
  226.      * Remove port.
  227.      */
  228.     public function removePort(\Aviatur\CruiserBundle\Entity\CruiserPortsGeolocalization $port)
  229.     {
  230.         $this->port->removeElement($port);
  231.     }
  232.     /**
  233.      * Get port.
  234.      *
  235.      * @return \Doctrine\Common\Collections\Collection
  236.      */
  237.     public function getPort()
  238.     {
  239.         return $this->port;
  240.     }
  241. }