6 declare(strict_types=1);
25 private $customerRepository;
30 private $serviceOutputProcessor;
35 private $jsonSerializer;
48 $this->serviceOutputProcessor = $serviceOutputProcessor;
49 $this->jsonSerializer = $jsonSerializer;
62 $customerObject = $this->customerRepository->getById(
$customerId);
67 return $this->processCustomer($customerObject);
78 $customer = $this->serviceOutputProcessor->process(
80 CustomerRepositoryInterface::class,
83 if (isset(
$customer[
'extension_attributes'])) {
86 $customAttributes = [];
87 if (isset(
$customer[
'custom_attributes'])) {
92 foreach (
$attribute[
'value'] as $attributeValue) {
93 if (is_array($attributeValue)) {
94 $customAttributes[
$attribute[
'attribute_code']] = $this->jsonSerializer->serialize(
getCustomerById(int $customerId)
__construct(CustomerRepositoryInterface $customerRepository, ServiceOutputProcessor $serviceOutputProcessor, SerializerInterface $jsonSerializer)