affilinetClient = $affilinetClient; } /** * @return \Psr\Http\Message\RequestInterface */ public function getPsr7Request() { return new Request('GET', $this->getEndpoint() . '?' . $this->serializeWithCredentials()); } /** * @return string */ protected function serializeWithCredentials() { $query = $this->queryParams; $query['PublisherId'] = $this->getAffilinetClient()->getPublisherId(); $query['Password'] = $this->getAffilinetClient()->getProductDataWebservicePassword(); return $this->buildQuery($query); } function buildQuery($params) { return http_build_query($params, '', '&'); } /** * @return AffilinetClient */ public function getAffilinetClient() { return $this->affilinetClient; } /** * @return string */ public function serialize() { $query = $this->queryParams; if (empty($query)) return ''; return http_build_query($query); } /** * @param string $serialized * @return $this */ public function unserialize($serialized) { $this->queryParams = []; parse_str($serialized, $this->queryParams); return $this; } }