<?php
namespace Aviatur\CustomerBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Gender.
*
* @ORM\Table(name="gender")
* @ORM\Entity
*/
class Gender
{
/**
* @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="externalCode", type="string", length=10, nullable=false)
*/
private $externalcode;
/**
* @var string
*
* @ORM\Column(name="description", type="string", length=50, nullable=false)
*/
private $description;
/**
* @ORM\OneToMany(targetEntity="Aviatur\CustomerBundle\Entity\Customer", mappedBy="genderAviatur", cascade={"all"})
*/
private $customer;
public function __toString()
{
$return = $this->getDescription().' ('.$this->getExternalcode().')';
return $return;
}
/**
* Constructor.
*/
public function __construct()
{
$this->customer = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set code.
*
* @param string $code
*
* @return Gender
*/
public function setCode($code)
{
$this->code = $code;
return $this;
}
/**
* Get code.
*
* @return string
*/
public function getCode()
{
return $this->code;
}
/**
* Set externalcode.
*
* @param string $externalcode
*
* @return Gender
*/
public function setExternalcode($externalcode)
{
$this->externalcode = $externalcode;
return $this;
}
/**
* Get externalcode.
*
* @return string
*/
public function getExternalcode()
{
return $this->externalcode;
}
/**
* Set description.
*
* @param string $description
*
* @return Gender
*/
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
* Get description.
*
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* Add customer.
*
* @return Gender
*/
public function addCustomer(\Aviatur\CustomerBundle\Entity\Customer $customer)
{
$this->customer[] = $customer;
return $this;
}
/**
* Remove customer.
*/
public function removeCustomer(\Aviatur\CustomerBundle\Entity\Customer $customer)
{
$this->customer->removeElement($customer);
}
/**
* Get customer.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getCustomer()
{
return $this->customer;
}
}