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

Open in your IDE?
  1. <?php
  2. namespace Aviatur\GeneralBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * PaymentType.
  6.  *
  7.  * @ORM\Table(name="payment_type")
  8.  * @ORM\Entity
  9.  */
  10. class PaymentType
  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="twig", type="string", length=50, nullable=false)
  30.      */
  31.     private $twig;
  32.     /**
  33.      * @var string
  34.      *
  35.      * @ORM\Column(name="description", type="string", length=100, nullable=false)
  36.      */
  37.     private $description;
  38.     /**
  39.      * @ORM\OneToMany(targetEntity="Aviatur\MpaBundle\Entity\Provider", mappedBy="paymentType", cascade={"all"})
  40.      */
  41.     private $provider;
  42.     public function __toString()
  43.     {
  44.         $return $this->getDescription().' ('.$this->getCode().')';
  45.         return $return;
  46.     }
  47.     /**
  48.      * Constructor.
  49.      */
  50.     public function __construct()
  51.     {
  52.         $this->provider = new \Doctrine\Common\Collections\ArrayCollection();
  53.     }
  54.     /**
  55.      * Get id.
  56.      *
  57.      * @return int
  58.      */
  59.     public function getId()
  60.     {
  61.         return $this->id;
  62.     }
  63.     /**
  64.      * Set code.
  65.      *
  66.      * @param string $code
  67.      *
  68.      * @return PaymentType
  69.      */
  70.     public function setCode($code)
  71.     {
  72.         $this->code $code;
  73.         return $this;
  74.     }
  75.     /**
  76.      * Get code.
  77.      *
  78.      * @return string
  79.      */
  80.     public function getCode()
  81.     {
  82.         return $this->code;
  83.     }
  84.     /**
  85.      * Set twig.
  86.      *
  87.      * @param string $twig
  88.      *
  89.      * @return PaymentType
  90.      */
  91.     public function setTwig($twig)
  92.     {
  93.         $this->twig $twig;
  94.         return $this;
  95.     }
  96.     /**
  97.      * Get twig.
  98.      *
  99.      * @return string
  100.      */
  101.     public function getTwig()
  102.     {
  103.         return $this->twig;
  104.     }
  105.     /**
  106.      * Set description.
  107.      *
  108.      * @param string $description
  109.      *
  110.      * @return PaymentType
  111.      */
  112.     public function setDescription($description)
  113.     {
  114.         $this->description $description;
  115.         return $this;
  116.     }
  117.     /**
  118.      * Get description.
  119.      *
  120.      * @return string
  121.      */
  122.     public function getDescription()
  123.     {
  124.         return $this->description;
  125.     }
  126.     /**
  127.      * Add provider.
  128.      *
  129.      * @return PaymentType
  130.      */
  131.     public function addProvider(\Aviatur\MpaBundle\Entity\Provider $provider)
  132.     {
  133.         $this->provider[] = $provider;
  134.         return $this;
  135.     }
  136.     /**
  137.      * Remove provider.
  138.      */
  139.     public function removeProvider(\Aviatur\MpaBundle\Entity\Provider $provider)
  140.     {
  141.         $this->provider->removeElement($provider);
  142.     }
  143.     /**
  144.      * Get provider.
  145.      *
  146.      * @return \Doctrine\Common\Collections\Collection
  147.      */
  148.     public function getProvider()
  149.     {
  150.         return $this->provider;
  151.     }
  152. }