Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Fahmi\Bundle\CustomerBundle\Entity;
- use Doctrine\ORM\Mapping as ORM;
- use Doctrine\ORM\EntityRepository;
- /**
- * @ORM\Entity
- * @ORM\Table(name="customer")
- */
- class Customer
- {
- /**
- * @var ArrayCollection
- * @ORM\OneToMany(targetEntity="Address", mappedBy="customer")
- */
- protected $address;
- /**
- * @ORM\Id
- * @ORM\Column(type="integer" )
- *
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- protected $customer_id;
- /**
- * @ORM\Column(type="string", length=255)
- *
- */
- protected $customer_name;
- /**
- * @ORM\Column(type="string", length=50)
- */
- protected $email_address;
- /**
- * @ORM\Column(type="string", length=20)
- */
- protected $phone_number;
- /**
- * @ORM\Column(type="datetime")
- */
- protected $date_created;
- public function __construct() {
- $date_created = new \DateTime();
- }
- /**
- * Set customer_id
- *
- * @param integer $customerId
- * @return Customer
- */
- public function setCustomerId($customerId)
- {
- $this->customer_id = $customerId;
- return $this;
- }
- /**
- * Get customer_id
- *
- * @return integer
- */
- public function getCustomerId()
- {
- return $this->customer_id;
- }
- /**
- * Set customer_name
- *
- * @param string $customerName
- * @return Customer
- */
- public function setCustomerName($customerName)
- {
- $this->customer_name = $customerName;
- return $this;
- }
- /**
- * Get customer_name
- *
- * @return string
- */
- public function getCustomerName()
- {
- return $this->customer_name;
- }
- /**
- * Set email_address
- *
- * @param string $emailAddress
- * @return Customer
- */
- public function setEmailAddress($emailAddress)
- {
- $this->email_address = $emailAddress;
- return $this;
- }
- /**
- * Get email_address
- *
- * @return string
- */
- public function getEmailAddress()
- {
- return $this->email_address;
- }
- /**
- * Set phone_number
- *
- * @param string $phoneNumber
- * @return Customer
- */
- public function setPhoneNumber($phoneNumber)
- {
- $this->phone_number = $phoneNumber;
- return $this;
- }
- /**
- * Get phone_number
- *
- * @return string
- */
- public function getPhoneNumber()
- {
- return $this->phone_number;
- }
- /**
- * Set date_created
- *
- * @param \DateTime $dateCreated
- * @return Customer
- */
- public function setDateCreated($dateCreated)
- {
- $this->date_created = $dateCreated;
- return $this;
- }
- /**
- * Get date_created
- *
- * @return \DateTime
- */
- public function getDateCreated()
- {
- return $this->date_created;
- }
- /**
- * Add address
- *
- * @param \Fahmi\Bundle\CustomerBundle\Entity\Address $address
- * @return Customer
- */
- public function addAddress(\Fahmi\Bundle\CustomerBundle\Entity\Address $address)
- {
- $this->address[] = $address;
- return $this;
- }
- /**
- * Remove address
- *
- * @param \Fahmi\Bundle\CustomerBundle\Entity\Address $address
- */
- public function removeAddress(\Fahmi\Bundle\CustomerBundle\Entity\Address $address)
- {
- $this->address->removeElement($address);
- }
- /**
- * Get address
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getAddress()
- {
- return $this->address;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement