/** * @param $customerId * @return Customer */ public function getCustomer($locale, $customerId) { $client = $this->getClient(); $request = CustomerByIdGetRequest::ofId($customerId); $response = $request->executeWithClient($client); $customer = $request->mapFromResponse($response, $this->mapperFactory->build($locale, $request->getResultClass())); return $customer; }
protected function getCustomer(User $user) { if (!$user instanceof User) { throw new \InvalidArgumentException(); } /** * @var Client $client */ $client = $this->get('commercetools.client'); $request = CustomerByIdGetRequest::ofId($user->getId()); $response = $request->executeWithClient($client); $customer = $request->mapResponse($response); return $customer; }