src/Aviatur/CustomerBundle/Entity/DocumentType.php line 14

Open in your IDE?
  1. <?php
  2. namespace Aviatur\CustomerBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * DocumentType.
  6.  *
  7.  * @ORM\Table(name="document_type")
  8.  * @ORM\Entity(repositoryClass="Aviatur\CustomerBundle\Repository\DocumentTypeRepository")
  9.  */
  10. class DocumentType
  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="externalCode", type="string", length=10, nullable=false)
  30.      */
  31.     private $externalcode;
  32.     /**
  33.      * @var string
  34.      *
  35.      * @ORM\Column(name="paymentCode", type="string", length=10, nullable=false)
  36.      */
  37.     private $paymentcode;
  38.     /**
  39.      * @var string
  40.      *
  41.      * @ORM\Column(name="description", type="string", length=50, nullable=false)
  42.      */
  43.     private $description;
  44.     /**
  45.      * @var bool
  46.      *
  47.      * @ORM\Column(name="active", type="boolean", nullable=false)
  48.      */
  49.     private $active true;
  50.     /**
  51.      * @ORM\OneToMany(targetEntity="Aviatur\CustomerBundle\Entity\Customer", mappedBy="documentType", cascade={"all"})
  52.      */
  53.     private $customer;
  54.     public function __toString()
  55.     {
  56.         $return $this->getDescription().' ('.$this->getExternalcode().')';
  57.         return $return;
  58.     }
  59.     /**
  60.      * Constructor.
  61.      */
  62.     public function __construct()
  63.     {
  64.         $this->customer = new \Doctrine\Common\Collections\ArrayCollection();
  65.     }
  66.     /**
  67.      * Get id.
  68.      *
  69.      * @return int
  70.      */
  71.     public function getId()
  72.     {
  73.         return $this->id;
  74.     }
  75.     /**
  76.      * Set code.
  77.      *
  78.      * @param string $code
  79.      *
  80.      * @return DocumentType
  81.      */
  82.     public function setCode($code)
  83.     {
  84.         $this->code $code;
  85.         return $this;
  86.     }
  87.     /**
  88.      * Get code.
  89.      *
  90.      * @return string
  91.      */
  92.     public function getCode()
  93.     {
  94.         return $this->code;
  95.     }
  96.     /**
  97.      * Set externalcode.
  98.      *
  99.      * @param string $externalcode
  100.      *
  101.      * @return DocumentType
  102.      */
  103.     public function setExternalcode($externalcode)
  104.     {
  105.         $this->externalcode $externalcode;
  106.         return $this;
  107.     }
  108.     /**
  109.      * Get externalcode.
  110.      *
  111.      * @return string
  112.      */
  113.     public function getExternalcode()
  114.     {
  115.         return $this->externalcode;
  116.     }
  117.     /**
  118.      * Set paymentcode.
  119.      *
  120.      * @param string $paymentcode
  121.      *
  122.      * @return DocumentType
  123.      */
  124.     public function setPaymentcode($paymentcode)
  125.     {
  126.         $this->paymentcode $paymentcode;
  127.         return $this;
  128.     }
  129.     /**
  130.      * Get paymentcode.
  131.      *
  132.      * @return string
  133.      */
  134.     public function getPaymentcode()
  135.     {
  136.         return $this->paymentcode;
  137.     }
  138.     /**
  139.      * Set description.
  140.      *
  141.      * @param string $description
  142.      *
  143.      * @return DocumentType
  144.      */
  145.     public function setDescription($description)
  146.     {
  147.         $this->description $description;
  148.         return $this;
  149.     }
  150.     /**
  151.      * Get description.
  152.      *
  153.      * @return string
  154.      */
  155.     public function getDescription()
  156.     {
  157.         return $this->description;
  158.     }
  159.     public function setActive($active)
  160.     {
  161.         $this->active $active;
  162.         return $this;
  163.     }
  164.     public function isActive()
  165.     {
  166.         return $this->active;
  167.     }
  168.     /**
  169.      * Add customer.
  170.      *
  171.      * @return DocumentType
  172.      */
  173.     public function addCustomer(\Aviatur\CustomerBundle\Entity\Customer $customer)
  174.     {
  175.         $this->customer[] = $customer;
  176.         return $this;
  177.     }
  178.     /**
  179.      * Remove customer.
  180.      */
  181.     public function removeCustomer(\Aviatur\CustomerBundle\Entity\Customer $customer)
  182.     {
  183.         $this->customer->removeElement($customer);
  184.     }
  185.     /**
  186.      * Get customer.
  187.      *
  188.      * @return \Doctrine\Common\Collections\Collection
  189.      */
  190.     public function getCustomer()
  191.     {
  192.         return $this->customer;
  193.     }
  194. }