Advertisement
fahmihilmansyah

customer

Jun 3rd, 2015
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.76 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Fahmi\Bundle\CustomerBundle\Entity;
  4.  
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Doctrine\ORM\EntityRepository;
  7.  
  8. /**
  9. * @ORM\Entity
  10. * @ORM\Table(name="customer")
  11. */
  12. class Customer
  13. {
  14.     /**
  15.      * @var ArrayCollection
  16.      * @ORM\OneToMany(targetEntity="Address", mappedBy="customer")
  17.      */
  18.     protected $address;
  19.     /**
  20.      * @ORM\Id
  21.      * @ORM\Column(type="integer" )
  22.      *
  23.      * @ORM\GeneratedValue(strategy="AUTO")
  24.      */
  25.      protected $customer_id;
  26.  
  27.      /**
  28.       * @ORM\Column(type="string", length=255)
  29.       *
  30.       */
  31.      protected $customer_name;
  32.  
  33.      /**
  34.       * @ORM\Column(type="string", length=50)
  35.       */
  36.      protected $email_address;
  37.  
  38.      /**
  39.       * @ORM\Column(type="string", length=20)
  40.       */
  41.      protected $phone_number;
  42.  
  43.      /**
  44.       * @ORM\Column(type="datetime")
  45.       */
  46.      protected $date_created;
  47.  
  48.       public function __construct() {
  49.         $date_created = new \DateTime();
  50.       }
  51.      
  52.  
  53.  
  54.  
  55.     /**
  56.      * Set customer_id
  57.      *
  58.      * @param integer $customerId
  59.      * @return Customer
  60.      */
  61.     public function setCustomerId($customerId)
  62.     {
  63.         $this->customer_id = $customerId;
  64.  
  65.         return $this;
  66.     }
  67.  
  68.     /**
  69.      * Get customer_id
  70.      *
  71.      * @return integer
  72.      */
  73.     public function getCustomerId()
  74.     {
  75.         return $this->customer_id;
  76.     }
  77.  
  78.     /**
  79.      * Set customer_name
  80.      *
  81.      * @param string $customerName
  82.      * @return Customer
  83.      */
  84.     public function setCustomerName($customerName)
  85.     {
  86.         $this->customer_name = $customerName;
  87.  
  88.         return $this;
  89.     }
  90.  
  91.     /**
  92.      * Get customer_name
  93.      *
  94.      * @return string
  95.      */
  96.     public function getCustomerName()
  97.     {
  98.         return $this->customer_name;
  99.     }
  100.  
  101.     /**
  102.      * Set email_address
  103.      *
  104.      * @param string $emailAddress
  105.      * @return Customer
  106.      */
  107.     public function setEmailAddress($emailAddress)
  108.     {
  109.         $this->email_address = $emailAddress;
  110.  
  111.         return $this;
  112.     }
  113.  
  114.     /**
  115.      * Get email_address
  116.      *
  117.      * @return string
  118.      */
  119.     public function getEmailAddress()
  120.     {
  121.         return $this->email_address;
  122.     }
  123.  
  124.     /**
  125.      * Set phone_number
  126.      *
  127.      * @param string $phoneNumber
  128.      * @return Customer
  129.      */
  130.     public function setPhoneNumber($phoneNumber)
  131.     {
  132.         $this->phone_number = $phoneNumber;
  133.  
  134.         return $this;
  135.     }
  136.  
  137.     /**
  138.      * Get phone_number
  139.      *
  140.      * @return string
  141.      */
  142.     public function getPhoneNumber()
  143.     {
  144.         return $this->phone_number;
  145.     }
  146.  
  147.     /**
  148.      * Set date_created
  149.      *
  150.      * @param \DateTime $dateCreated
  151.      * @return Customer
  152.      */
  153.     public function setDateCreated($dateCreated)
  154.     {
  155.         $this->date_created = $dateCreated;
  156.  
  157.         return $this;
  158.     }
  159.  
  160.     /**
  161.      * Get date_created
  162.      *
  163.      * @return \DateTime
  164.      */
  165.     public function getDateCreated()
  166.     {
  167.         return $this->date_created;
  168.     }
  169.  
  170.     /**
  171.      * Add address
  172.      *
  173.      * @param \Fahmi\Bundle\CustomerBundle\Entity\Address $address
  174.      * @return Customer
  175.      */
  176.     public function addAddress(\Fahmi\Bundle\CustomerBundle\Entity\Address $address)
  177.     {
  178.         $this->address[] = $address;
  179.  
  180.         return $this;
  181.     }
  182.  
  183.     /**
  184.      * Remove address
  185.      *
  186.      * @param \Fahmi\Bundle\CustomerBundle\Entity\Address $address
  187.      */
  188.     public function removeAddress(\Fahmi\Bundle\CustomerBundle\Entity\Address $address)
  189.     {
  190.         $this->address->removeElement($address);
  191.     }
  192.  
  193.     /**
  194.      * Get address
  195.      *
  196.      * @return \Doctrine\Common\Collections\Collection
  197.      */
  198.     public function getAddress()
  199.     {
  200.         return $this->address;
  201.     }
  202. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement