<?php
namespace Aviatur\GeneralBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* PaymentType.
*
* @ORM\Table(name="payment_type")
* @ORM\Entity
*/
class PaymentType
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="code", type="string", length=10, nullable=false)
*/
private $code;
/**
* @var string
*
* @ORM\Column(name="twig", type="string", length=50, nullable=false)
*/
private $twig;
/**
* @var string
*
* @ORM\Column(name="description", type="string", length=100, nullable=false)
*/
private $description;
/**
* @ORM\OneToMany(targetEntity="Aviatur\MpaBundle\Entity\Provider", mappedBy="paymentType", cascade={"all"})
*/
private $provider;
public function __toString()
{
$return = $this->getDescription().' ('.$this->getCode().')';
return $return;
}
/**
* Constructor.
*/
public function __construct()
{
$this->provider = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set code.
*
* @param string $code
*
* @return PaymentType
*/
public function setCode($code)
{
$this->code = $code;
return $this;
}
/**
* Get code.
*
* @return string
*/
public function getCode()
{
return $this->code;
}
/**
* Set twig.
*
* @param string $twig
*
* @return PaymentType
*/
public function setTwig($twig)
{
$this->twig = $twig;
return $this;
}
/**
* Get twig.
*
* @return string
*/
public function getTwig()
{
return $this->twig;
}
/**
* Set description.
*
* @param string $description
*
* @return PaymentType
*/
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
* Get description.
*
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* Add provider.
*
* @return PaymentType
*/
public function addProvider(\Aviatur\MpaBundle\Entity\Provider $provider)
{
$this->provider[] = $provider;
return $this;
}
/**
* Remove provider.
*/
public function removeProvider(\Aviatur\MpaBundle\Entity\Provider $provider)
{
$this->provider->removeElement($provider);
}
/**
* Get provider.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getProvider()
{
return $this->provider;
}
}