Esempio n. 1
0
 /**
  * @param CustomerView $customer
  * @return \Symfony\Component\Form\FormInterface
  */
 private function getOrderForm(CustomerView $customer)
 {
     return $form = $this->formFactory->create('Shop\\Presentation\\Form\\OrderType', new CreateOrderCommand(new Address($customer->getCountry(), $customer->getCity(), $customer->getStreet(), $customer->getZipCode())));
 }
Esempio n. 2
0
 /**
  * @param CustomerView $customer
  * @return \Symfony\Component\Form\FormInterface
  */
 private function createForm($customer)
 {
     $form = $this->formFactory->create('Shop\\Presentation\\Form\\ProfileType', new UpdateProfileCommand(new Address($customer->getCountry(), $customer->getCity(), $customer->getStreet(), $customer->getZipCode())));
     return $form;
 }
Esempio n. 3
0
 protected function createViewModel($item)
 {
     return CustomerView::create($item['id'], $item['email'], $item['country'], $item['city'], $item['street'], $item['zipCode']);
 }
 public function notify(ProfileUpdatedEvent $event)
 {
     $user = $event->getUser();
     $view = CustomerView::create($user->getId(), $user->getUsername(), $user->getAddress()->getCountry(), $user->getAddress()->getCity(), $user->getAddress()->getStreet(), $user->getAddress()->getZipCode());
     $this->repository->save($view);
 }