Exemplo n.º 1
0
 /**
  * @param $customer
  * @return array
  */
 public function formatCustomerEntity(Customer $customer)
 {
     //$customFields = CustomFieldFacade::formatCustomFieldCollection($customer->getCustomFields());
     return array("id" => $customer->getUniqueId(), "firstName" => $customer->getFirstName(), "lastName" => $customer->getLastName(), "cardCode" => $customer->getCardCode(), "cardNumber" => $customer->getCardNumber(), "phone" => $customer->getPhone(), "email" => $customer->getEmail(), "city" => $customer->getCity(), "state" => $customer->getState(), "country" => $customer->getCountry(), "address1" => $customer->getAddress1(), "address2" => $customer->getAddress2(), "customFields" => $customer->getCustomFields());
 }
Exemplo n.º 2
0
 /**
  * @return JsonModel
  */
 public function editAction()
 {
     $user = $this->zfcUserAuthentication()->getIdentity();
     if (UserHelper::isMerchant($user) && RequestHelper::isPost($this->getRequest())) {
         $customer = new Customer();
         $customFields = $this->getServiceLocator()->get('customerService')->getCustomFields($user->getAccount());
         $customer->fillFromPost($this->getRequest()->getPost(), $customFields);
         $customerService = $this->getServiceLocator()->get('customerService');
         $customerService->editCustomer($customer, $user->getAccount());
         return new JsonModel(array('message' => "Customer updated successfully"));
     }
 }