You are here

public function People::peopleFindByUsername in Flickr API Integration 8

Return a user's NSID, given their username.

Parameters

string $username: Username to look for.

bool $cacheable: Cacheable.

Return value

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

File

src/Service/People.php, line 73

Class

People
Class People.

Namespace

Drupal\flickr_api\Service

Code

public function peopleFindByUsername($username, $cacheable = TRUE) {
  $args = [
    'username' => $username,
  ];
  $response = $this->client
    ->request('flickr.people.findByUsername', $args, $cacheable);
  if ($response) {
    return $response['user'];
  }
  return FALSE;
}