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

Open in your IDE?
  1. <?php
  2. namespace Aviatur\GeneralBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * City.
  6.  *
  7.  * @ORM\Table(name="city", indexes={@ORM\Index(name="IDX_8D69AD0AF92F3E70", columns={"country_id"})})
  8.  * @ORM\Entity(repositoryClass="Aviatur\GeneralBundle\Entity\CityRepository")
  9.  */
  10. class City
  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.      * @var string
  46.      *
  47.      * @ORM\Column(name="countryStateCode", type="string", length=10, nullable=false)
  48.      */
  49.     private $countrystatecode;
  50.     /**
  51.      *
  52.      * @ORM\ManyToOne(targetEntity="Country", inversedBy="city")
  53.      * @ORM\JoinColumns({
  54.      *   @ORM\JoinColumn(name="country_id", referencedColumnName="id")
  55.      * })
  56.      */
  57.     private ?\Aviatur\GeneralBundle\Entity\Country $country null;
  58.     /**
  59.      * @ORM\OneToMany(targetEntity="Aviatur\CustomerBundle\Entity\Customer", mappedBy="city", cascade={"all"})
  60.      */
  61.     private $customer;
  62.     /**
  63.      * @ORM\OneToMany(targetEntity="Aviatur\FlightBundle\Entity\AdminFee", mappedBy="city", cascade={"all"})
  64.      */
  65.     private $adminFee;
  66.     /**
  67.      * @ORM\OneToMany(targetEntity="Aviatur\FlightBundle\Entity\AdminFeeActivityLog", mappedBy="order", cascade={"all"})
  68.      */
  69.     private $adminFeeActivityLog;
  70.     public function __toString()
  71.     {
  72.         $return $this->getDescription().' ('.$this->getIatacode().')'.' - '.$this->getCountry();
  73.         return $return;
  74.     }
  75.     /**
  76.      * Constructor.
  77.      */
  78.     public function __construct()
  79.     {
  80.         $this->adminFee = new \Doctrine\Common\Collections\ArrayCollection();
  81.         $this->customer = new \Doctrine\Common\Collections\ArrayCollection();
  82.         $this->adminFeeActivityLog = new \Doctrine\Common\Collections\ArrayCollection();
  83.     }
  84.     /**
  85.      * Get id.
  86.      *
  87.      * @return int
  88.      */
  89.     public function getId()
  90.     {
  91.         return $this->id;
  92.     }
  93.     /**
  94.      * Set code.
  95.      *
  96.      * @param string $code
  97.      *
  98.      * @return City
  99.      */
  100.     public function setCode($code)
  101.     {
  102.         $this->code $code;
  103.         return $this;
  104.     }
  105.     /**
  106.      * Get code.
  107.      *
  108.      * @return string
  109.      */
  110.     public function getCode()
  111.     {
  112.         return $this->code;
  113.     }
  114.     /**
  115.      * Set iatacode.
  116.      *
  117.      * @param string $iatacode
  118.      *
  119.      * @return City
  120.      */
  121.     public function setIatacode($iatacode)
  122.     {
  123.         $this->iatacode $iatacode;
  124.         return $this;
  125.     }
  126.     /**
  127.      * Get iatacode.
  128.      *
  129.      * @return string
  130.      */
  131.     public function getIatacode()
  132.     {
  133.         return $this->iatacode;
  134.     }
  135.     /**
  136.      * Set languagecode.
  137.      *
  138.      * @param string $languagecode
  139.      *
  140.      * @return City
  141.      */
  142.     public function setLanguagecode($languagecode)
  143.     {
  144.         $this->languagecode $languagecode;
  145.         return $this;
  146.     }
  147.     /**
  148.      * Get languagecode.
  149.      *
  150.      * @return string
  151.      */
  152.     public function getLanguagecode()
  153.     {
  154.         return $this->languagecode;
  155.     }
  156.     /**
  157.      * Set description.
  158.      *
  159.      * @param string $description
  160.      *
  161.      * @return City
  162.      */
  163.     public function setDescription($description)
  164.     {
  165.         $this->description $description;
  166.         return $this;
  167.     }
  168.     /**
  169.      * Get description.
  170.      *
  171.      * @return string
  172.      */
  173.     public function getDescription()
  174.     {
  175.         return $this->description;
  176.     }
  177.     /**
  178.      * Set countrystatecode.
  179.      *
  180.      * @param string $countrystatecode
  181.      *
  182.      * @return City
  183.      */
  184.     public function setCountrystatecode($countrystatecode)
  185.     {
  186.         $this->countrystatecode $countrystatecode;
  187.         return $this;
  188.     }
  189.     /**
  190.      * Get countrystatecode.
  191.      *
  192.      * @return string
  193.      */
  194.     public function getCountrystatecode()
  195.     {
  196.         return $this->countrystatecode;
  197.     }
  198.     /**
  199.      * Set country.
  200.      *
  201.      * @param \Aviatur\GeneralBundle\Entity\Country $country
  202.      *
  203.      * @return City
  204.      */
  205.     public function setCountry(\Aviatur\GeneralBundle\Entity\Country $country null)
  206.     {
  207.         $this->country $country;
  208.         return $this;
  209.     }
  210.     /**
  211.      * Get country.
  212.      *
  213.      * @return \Aviatur\GeneralBundle\Entity\Country
  214.      */
  215.     public function getCountry()
  216.     {
  217.         return $this->country;
  218.     }
  219.     /**
  220.      * Add customer.
  221.      *
  222.      * @return City
  223.      */
  224.     public function addCustomer(\Aviatur\CustomerBundle\Entity\Customer $customer)
  225.     {
  226.         $this->customer[] = $customer;
  227.         return $this;
  228.     }
  229.     /**
  230.      * Remove customer.
  231.      */
  232.     public function removeCustomer(\Aviatur\CustomerBundle\Entity\Customer $customer)
  233.     {
  234.         $this->customer->removeElement($customer);
  235.     }
  236.     /**
  237.      * Get customer.
  238.      *
  239.      * @return \Doctrine\Common\Collections\Collection
  240.      */
  241.     public function getCustomer()
  242.     {
  243.         return $this->customer;
  244.     }
  245.     /**
  246.      * Remove adminFee.
  247.      */
  248.     public function removeAdminFee(\Aviatur\FlightBundle\Entity\AdminFee $adminFee)
  249.     {
  250.         $this->adminFee->removeElement($adminFee);
  251.     }
  252.     /**
  253.      * Get adminFee.
  254.      *
  255.      * @return \Doctrine\Common\Collections\Collection
  256.      */
  257.     public function getAdminFee()
  258.     {
  259.         return $this->adminFee;
  260.     }
  261.     /**
  262.      * Add adminFee.
  263.      *
  264.      * @return City
  265.      */
  266.     public function addAdminFee(\Aviatur\FlightBundle\Entity\AdminFee $adminFee)
  267.     {
  268.         $this->adminFee[] = $adminFee;
  269.         return $this;
  270.     }
  271.     /**
  272.      * Add adminFeeActivityLog.
  273.      *
  274.      * @return AdminFeeActivityLog
  275.      */
  276.     public function addAdminFeeActivityLog(\Aviatur\FlightBundle\Entity\AdminFeeActivityLog $adminFeeActivityLog)
  277.     {
  278.         $this->adminFeeActivityLog[] = $adminFeeActivityLog;
  279.         return $this;
  280.     }
  281.     /**
  282.      * Remove AdminFeeActivityLog.
  283.      */
  284.     public function removeAdminFeeActivityLog(\Aviatur\FlightBundle\Entity\AdminFeeActivityLog $adminFeeActivityLog)
  285.     {
  286.         $this->adminFeeActivityLog->removeElement($adminFeeActivityLog);
  287.     }
  288.     /**
  289.      * Get AdminFeeActivityLog.
  290.      *
  291.      * @return \Doctrine\Common\Collections\Collection
  292.      */
  293.     public function getAdminFeeActivityLog()
  294.     {
  295.         return $this->adminFeeActivityLog;
  296.     }
  297. }