/** * @param array $data * @param string $resourceUrl * @param string $sourceUrl * @param int $batchesLimit * @return Iterator */ public function getFollowData($data, $resourceUrl, $sourceUrl, $batchesLimit = 0) { $requestData = array_merge([$data, $resourceUrl, $sourceUrl]); return Pagination::getPaginatedData([$this, 'getData'], $requestData, $batchesLimit); }
/** * Executes search to API with pagination. * * @param string $query * @param int $batchesLimit * @return \Iterator */ public function searchWithPagination($query, $batchesLimit) { return Pagination::getPaginatedData([$this, 'searchCall'], ['query' => $query, 'scope' => $this->getScope()], $batchesLimit); }
/** * Wrapper over Pagination::getPaginatedData for * high-level functions, such as 'following', 'pins' and others. * * @param string $username * @param string $url * @param string $sourceUrl * @param integer $batchesLimit * @return Iterator */ protected function getPaginatedData($username, $url, $sourceUrl, $batchesLimit) { $data = [['username' => $username], $url, $sourceUrl]; return Pagination::getPaginatedData([$this, 'getData'], $data, $batchesLimit); }
/** * Get pins from board by boardId * * @param int $boardId * @param int $batchesLimit * @return Iterator */ public function pins($boardId, $batchesLimit = 0) { return Pagination::getPaginatedData([$this, 'getPinsFromBoard'], ['boardId' => $boardId], $batchesLimit); }