/** * Set customer parameters from customer entity. * * @param Siwapp\CustomerBundle\Entity\Customer $customer */ public function setFromCustomer(Customer $customer) { if (empty($this->customer_name) && $customer->getName()) { $this->customer_name = $customer->getName(); } if (empty($this->customer_email) && $customer->getEmail()) { $this->customer_email = $customer->getEmail(); } if (empty($this->customer_identification) && $customer->getIdentification()) { $this->customer_identification = $customer->getIdentification(); } if (empty($this->contact_person) && $customer->getContactPerson()) { $this->contact_person = $customer->getContactPerson(); } if (empty($this->invoicing_address) && $customer->getInvoicingAddress()) { $this->invoicing_address = $customer->getInvoicingAddress(); } if (empty($this->shipping_address) && $customer->getShippingAddress()) { $this->shipping_address = $customer->getShippingAddress(); } }