/** * {@inheritdoc} */ public function getUserPromotions(User $user) { $promotionsUrl = sprintf(self::USER_PROMOTIONS, $user->getId()); $url = $this->getUrl($promotionsUrl); $response = $this->prepareRequest(Http::GET, $url)->send(); $data = $this->getSuccessData($response); $result = []; foreach ($data as $userPromotionData) { $result[] = UserPromotion::createFromStdClass($userPromotionData); } return $result; }