public function People::peopleGetPublicPhotos in Flickr API Integration 8
Returns a list of public photos for the given user.
Parameters
string $nsid: NSID of the user whose photos you want.
int $page: Page.
array $otherArgs: Other args.
bool $cacheable: Cacheable.
Return value
array Response from the flickr method flickr.people.getPublicPhotos. (https://www.flickr.com/services/api/flickr.people.getPublicPhotos.html)
File
- src/
Service/ People.php, line 167
Class
- People
- Class People.
Namespace
Drupal\flickr_api\ServiceCode
public function peopleGetPublicPhotos($nsid, $page = 1, array $otherArgs = [], $cacheable = TRUE) {
$args = [
'user_id' => $nsid,
'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.people.getPublicPhotos', $args, $cacheable);
if ($response) {
return $response['photos'];
}
return FALSE;
}