Ejemplo n.º 1
0
 /**
  * @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);
 }
Ejemplo n.º 2
0
 /**
  * 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);
 }
Ejemplo n.º 3
0
 /**
  * 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);
 }
Ejemplo n.º 4
0
 /**
  * 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);
 }