<?php
namespace Aviatur\TrmBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Currency
*
* @ORM\Table(name="currency")
* @ORM\Entity
*/
class Currency {
/**
* @var integer
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="iata", type="string", length=45, nullable=false)
*/
private $iata;
/**
* @var string
*
* @ORM\Column(name="symbol", type="string", length=45, nullable=false)
*/
private $symbol;
/**
* @var string
*
* @ORM\Column(name="description", type="string", length=45, nullable=false)
*/
private $description;
/**
* @ORM\OneToMany(targetEntity="Aviatur\TrmBundle\Entity\Trm", mappedBy="fromCurrency", cascade={"all"})
*/
private $trmFromCurrency;
/**
* @ORM\OneToMany(targetEntity="Aviatur\TrmBundle\Entity\Trm", mappedBy="toCurrency", cascade={"all"})
*/
private $trmToCurrency;
public function __toString() {
$return = $this->getDescription() . " (" . $this->getIata() . ")";
return $return;
}
/**
* Constructor
*/
public function __construct() {
$this->trmFromCurrency = new \Doctrine\Common\Collections\ArrayCollection();
$this->trmToCurrency = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id
*
* @return integer
*/
public function getId() {
return $this->id;
}
/**
* Set iata
*
* @param string $iata
* @return Currency
*/
public function setIata($iata) {
$this->iata = $iata;
return $this;
}
/**
* Get iata
*
* @return string
*/
public function getIata() {
return $this->iata;
}
/**
* Set description
*
* @param string $description
* @return Currency
*/
public function setDescription($description) {
$this->description = $description;
return $this;
}
/**
* Get description
*
* @return string
*/
public function getDescription() {
return $this->description;
}
/**
* Set symbol
*
* @param string $symbol
* @return Currency
*/
public function setSymbol($symbol) {
$this->symbol = $symbol;
return $this;
}
/**
* Get symbol
*
* @return string
*/
public function getSymbol() {
return $this->symbol;
}
/**
* Add trmFromCurrency
*
* @param \Aviatur\TrmBundle\Entity\Trm $trmFromCurrency
* @return Currency
*/
public function addTrmFromCurrency(\Aviatur\TrmBundle\Entity\Trm $trmFromCurrency) {
$this->trmFromCurrency[] = $trmFromCurrency;
return $this;
}
/**
* Remove trmFromCurrency
*
* @param \Aviatur\TrmBundle\Entity\Trm $trmFromCurrency
*/
public function removeTrmFromCurrency(\Aviatur\TrmBundle\Entity\Trm $trmFromCurrency) {
$this->trmFromCurrency->removeElement($trmFromCurrency);
}
/**
* Get trmFromCurrency
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getTrmFromCurrency() {
return $this->trmFromCurrency;
}
/**
* Add trmToCurrency
*
* @param \Aviatur\TrmBundle\Entity\Trm $trmToCurrency
* @return Currency
*/
public function addTrmToCurrency(\Aviatur\TrmBundle\Entity\Trm $trmToCurrency) {
$this->trmToCurrency[] = $trmToCurrency;
return $this;
}
/**
* Remove trmToCurrency
*
* @param \Aviatur\TrmBundle\Entity\Trm $trmToCurrency
*/
public function removeTrmToCurrency(\Aviatur\TrmBundle\Entity\Trm $trmToCurrency) {
$this->trmToCurrency->removeElement($trmToCurrency);
}
/**
* Get trmToCurrency
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getTrmToCurrency() {
return $this->trmToCurrency;
}
}