You are here

public function Photosets::photosetsGetPhotos in Flickr API Integration 8

Get the list of photos in a set.

Parameters

string $photosetId: The Flickr API photoset ID.

array $otherArgs: Other args.

int $page: Page.

bool $cacheable: Cacheable.

Return value

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

File

src/Service/Photosets.php, line 116

Class

Photosets
Class Photosets.

Namespace

Drupal\flickr_api\Service

Code

public function photosetsGetPhotos($photosetId, array $otherArgs = [], $page = 1, $cacheable = TRUE) {
  $args = [
    'photoset_id' => $photosetId,
    'page' => $page,
  ];
  $args = array_merge($args, $otherArgs);

  // Set per_page to flickr_api module default if not specified in $args.
  if (!isset($args['per_page'])) {

    // TODO Expose pager as a setting.
    $args['per_page'] = 6;
  }
  if (!isset($args['extras'])) {
    $args['extras'] = implode(',', $this
      ->photosetsGetPhotosExtras());
  }
  $response = $this->client
    ->request('flickr.photosets.getPhotos', $args, $cacheable);
  if ($response) {
    return $response['photoset'];
  }
  return FALSE;
}