src/Aviatur/TrmBundle/Entity/Currency.php line 13

Open in your IDE?
  1. <?php
  2. namespace Aviatur\TrmBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * Currency
  6.  *
  7.  * @ORM\Table(name="currency")
  8.  * @ORM\Entity
  9.  */
  10. class Currency {
  11.     /**
  12.      * @var integer
  13.      *
  14.      * @ORM\Column(name="id", type="integer", nullable=false)
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue(strategy="IDENTITY")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @var string
  21.      *
  22.      * @ORM\Column(name="iata", type="string", length=45, nullable=false)
  23.      */
  24.     private $iata;
  25.     /**
  26.      * @var string
  27.      *
  28.      * @ORM\Column(name="symbol", type="string", length=45, nullable=false)
  29.      */
  30.     private $symbol;
  31.     /**
  32.      * @var string
  33.      *
  34.      * @ORM\Column(name="description", type="string", length=45, nullable=false)
  35.      */
  36.     private $description;
  37.     /**
  38.      * @ORM\OneToMany(targetEntity="Aviatur\TrmBundle\Entity\Trm", mappedBy="fromCurrency", cascade={"all"})
  39.      */
  40.     private $trmFromCurrency;
  41.     /**
  42.      * @ORM\OneToMany(targetEntity="Aviatur\TrmBundle\Entity\Trm", mappedBy="toCurrency", cascade={"all"})
  43.      */
  44.     private $trmToCurrency;
  45.     public function __toString() {
  46.         $return $this->getDescription() . " (" $this->getIata() . ")";
  47.         return $return;
  48.     }
  49.     /**
  50.      * Constructor
  51.      */
  52.     public function __construct() {
  53.         $this->trmFromCurrency = new \Doctrine\Common\Collections\ArrayCollection();
  54.         $this->trmToCurrency = new \Doctrine\Common\Collections\ArrayCollection();
  55.     }
  56.     /**
  57.      * Get id
  58.      *
  59.      * @return integer 
  60.      */
  61.     public function getId() {
  62.         return $this->id;
  63.     }
  64.     /**
  65.      * Set iata
  66.      *
  67.      * @param string $iata
  68.      * @return Currency
  69.      */
  70.     public function setIata($iata) {
  71.         $this->iata $iata;
  72.         return $this;
  73.     }
  74.     /**
  75.      * Get iata
  76.      *
  77.      * @return string 
  78.      */
  79.     public function getIata() {
  80.         return $this->iata;
  81.     }
  82.     /**
  83.      * Set description
  84.      *
  85.      * @param string $description
  86.      * @return Currency
  87.      */
  88.     public function setDescription($description) {
  89.         $this->description $description;
  90.         return $this;
  91.     }
  92.     /**
  93.      * Get description
  94.      *
  95.      * @return string 
  96.      */
  97.     public function getDescription() {
  98.         return $this->description;
  99.     }
  100.     /**
  101.      * Set symbol
  102.      *
  103.      * @param string $symbol
  104.      * @return Currency
  105.      */
  106.     public function setSymbol($symbol) {
  107.         $this->symbol $symbol;
  108.         return $this;
  109.     }
  110.     /**
  111.      * Get symbol
  112.      *
  113.      * @return string 
  114.      */
  115.     public function getSymbol() {
  116.         return $this->symbol;
  117.     }
  118.     /**
  119.      * Add trmFromCurrency
  120.      *
  121.      * @param \Aviatur\TrmBundle\Entity\Trm $trmFromCurrency
  122.      * @return Currency
  123.      */
  124.     public function addTrmFromCurrency(\Aviatur\TrmBundle\Entity\Trm $trmFromCurrency) {
  125.         $this->trmFromCurrency[] = $trmFromCurrency;
  126.         return $this;
  127.     }
  128.     /**
  129.      * Remove trmFromCurrency
  130.      *
  131.      * @param \Aviatur\TrmBundle\Entity\Trm $trmFromCurrency
  132.      */
  133.     public function removeTrmFromCurrency(\Aviatur\TrmBundle\Entity\Trm $trmFromCurrency) {
  134.         $this->trmFromCurrency->removeElement($trmFromCurrency);
  135.     }
  136.     /**
  137.      * Get trmFromCurrency
  138.      *
  139.      * @return \Doctrine\Common\Collections\Collection 
  140.      */
  141.     public function getTrmFromCurrency() {
  142.         return $this->trmFromCurrency;
  143.     }
  144.     /**
  145.      * Add trmToCurrency
  146.      *
  147.      * @param \Aviatur\TrmBundle\Entity\Trm $trmToCurrency
  148.      * @return Currency
  149.      */
  150.     public function addTrmToCurrency(\Aviatur\TrmBundle\Entity\Trm $trmToCurrency) {
  151.         $this->trmToCurrency[] = $trmToCurrency;
  152.         return $this;
  153.     }
  154.     /**
  155.      * Remove trmToCurrency
  156.      *
  157.      * @param \Aviatur\TrmBundle\Entity\Trm $trmToCurrency
  158.      */
  159.     public function removeTrmToCurrency(\Aviatur\TrmBundle\Entity\Trm $trmToCurrency) {
  160.         $this->trmToCurrency->removeElement($trmToCurrency);
  161.     }
  162.     /**
  163.      * Get trmToCurrency
  164.      *
  165.      * @return \Doctrine\Common\Collections\Collection 
  166.      */
  167.     public function getTrmToCurrency() {
  168.         return $this->trmToCurrency;
  169.     }
  170. }