FacebookRestClient::photos_get PHP Method

photos_get() public method

Returns photos according to the filters specified.
public photos_get ( integer $subj_id, integer $aid, array $pids ) : array
$subj_id integer Optional: Filter by uid of user tagged in the photos.
$aid integer Optional: Filter by an album, as returned by photos_getAlbums.
$pids array Optional: Restrict to a list of pids Note that at least one of these parameters needs to be specified, or an error is returned.
return array of photo objects.
    public function photos_get($subj_id, $aid, $pids)
    {
        return $this->call_method('facebook.photos.get', array('subj_id' => $subj_id, 'aid' => $aid, 'pids' => $pids));
    }

Usage Example

 $uid = $session_info['uid'];
 // Get the entire user profile.
 $user_profile = $client->users_getInfo($uid, $profile_field_array);
 $user_name = $user_profile[0]['name'];
 // Get five of the user's friends.
 $friends_array = array_slice($client->friends_get(), 0, 5);
 // See if these two friends know each other.
 if (isset($friends_array[0]) && isset($friends_array[1])) {
     $friend_info = $client->friends_areFriends($friends_array[0], $friends_array[1]);
 }
 // Get all of this user's photo albums.
 $albums = $client->photos_getAlbums($uid, null);
 if (!empty($albums)) {
     $album = $albums[0];
     // Get all photos from this album.
     $album_photos = $client->photos_get(null, $album['aid'], null);
 }
 // Get the profiles of users' five friends.
 $friend_profiles = $client->users_getInfo($friends_array, $profile_field_array);
 // Get events for the next few weeks.
 $events = $client->events_get($uid, null, time(), time() + 86400 * 21, null);
 if (isset($events[0])) {
     $first_event_eid = $events[0]['eid'];
     $event_members = $client->events_getMembers($events[0]['eid']);
     $event_count = count($event_members['attending']);
 }
 // Get all photos of the user, trim to 10.
 $photos = array_slice($client->photos_get($uid, null, null), 0, 10);
 // Get all notifications for the current user.
 $notifications = $client->notifications_get();
 // Get the user's groups, and save a few