You are here

public function Photosets::photosetsGetList in Flickr API Integration 8

Returns the photosets belonging to the specified user.

Parameters

string $nsid: NSID of the user whose photoset list you want.

int $page: Page.

int $perPage: Per Page.

bool $cacheable: Cacheable.

Return value

array Response from the flickr method flickr.photosets.getList. (https://www.flickr.com/services/api/flickr.photosets.getList.html)

File

src/Service/Photosets.php, line 74

Class

Photosets
Class Photosets.

Namespace

Drupal\flickr_api\Service

Code

public function photosetsGetList($nsid, $page = NULL, $perPage = NULL, $cacheable = TRUE) {
  $args = [
    'user_id' => $nsid,
  ];
  if ($page != NULL) {
    $args['page'] = $page;
  }
  if ($perPage != NULL) {
    $args['per_page'] = $perPage;
  }
  $response = $this->client
    ->request('flickr.photosets.getList', $args, $cacheable);
  if ($response) {
    return $response['photosets']['photoset'];
  }
  return FALSE;
}