params = $params; $this->httpClient = $httpClient; $this->requestStack = $requestStack; } public function readMultiple(array $elementIds, array $idTypes, bool $allFields = false) { return $this->httpClient->data('POST', $this->params->get('domain_pim') . '/element_value/multiple.json', [ 'headers' => [ 'x-auth-token' => $this->requestStack->getCurrentRequest()->headers->get('x-auth-token'), ], 'json' => [ 'elementIds' => $elementIds, 'types' => $idTypes, 'allFields' => $allFields ], ] ); } public function readByProtocolAndElement(array $fields, array $elementIds) { $result = []; $data = $this->httpClient->data('POST', $this->params->get('domain_pim') . '/element_value/protocol.json', [ 'headers' => [ 'x-auth-token' => $this->requestStack->getCurrentRequest()->headers->get('x-auth-token'), ], 'json' => [ 'fields' => $fields, 'elementIds' => $elementIds ], ] ); if($data['type'] === "success"){ $result = $data['data']; } return $result; } }