You are here

public function Galleries::galleriesGetPhotos in Flickr API Integration 8

Returns a list of photos for a given gallery.

Parameters

string $id: ID of the gallery.

int $page: Page.

array $otherArgs: Other args.

bool $cacheable: Cacheable.

Return value

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

File

src/Service/Galleries.php, line 77

Class

Galleries
Class Galleries.

Namespace

Drupal\flickr_api\Service

Code

public function galleriesGetPhotos($id, $page = 1, array $otherArgs = [], $cacheable = TRUE) {
  $args = [
    'gallery_id' => $id,
    '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;
  }
  $response = $this->client
    ->request('flickr.galleries.getPhotos', $args, $cacheable);
  if ($response) {
    return $response['photos'];
  }
  return FALSE;
}