/** * @param integer $entityId * @return string */ public function createFollowRequestQuery($entityId) { $entityName = $this->getEntityIdName(); $dataJson = ['options' => [$entityName => (string) $entityId], 'context' => []]; if ($entityName == 'interest_id') { $dataJson['options']['interest_list'] = 'favorited'; } $post = ['data' => json_encode($dataJson, JSON_FORCE_OBJECT)]; return UrlBuilder::buildRequestString($post); }
/** * Creates Pinterest API search request. * * @param string $query * @param string $scope * @param array $bookmarks * * @return string */ protected function createSearchQuery($query, $scope, $bookmarks = []) { $dataJson = $this->appendBookMarks($bookmarks, ['scope' => $scope, 'query' => $query]); $request = Request::createRequestData($dataJson, $bookmarks); return UrlBuilder::buildRequestString($request); }
/** * Create request string. * * @param array $data * @param array $bookmarks * * @return string */ public static function createQuery(array $data = [], $bookmarks = []) { $data = empty($data) ? new \stdClass() : $data; $request = self::createRequestData(['options' => $data], $bookmarks); return UrlBuilder::buildRequestString($request); }