/** * @param ShopUserInterface $user */ private function blame(ShopUserInterface $user) { $cart = $this->getCart(); if (null === $cart) { return; } $cart->setCustomer($user->getCustomer()); $this->cartManager->persist($cart); $this->cartManager->flush(); }
/** * @Given /^(I) have an (address "[^"]+", "[^"]+", "[^"]+", "[^"]+", "[^"]+"(?:|, "[^"]+")) in my address book$/ */ public function iHaveAnAddressInAddressBook(ShopUserInterface $user, AddressInterface $address) { /** @var CustomerInterface $customer */ $customer = $user->getCustomer(); $this->thisCustomerHasAnAddressInAddressBook($customer, $address); }