GraphQL\Examples\Blog\Data\DataSource::getUserPhoto PHP Méthode

getUserPhoto() public static méthode

public static getUserPhoto ( $userId, $size )
    public static function getUserPhoto($userId, $size)
    {
        return new Image(['id' => $userId, 'type' => Image::TYPE_USERPIC, 'size' => $size, 'width' => rand(100, 200), 'height' => rand(100, 200)]);
    }

Usage Example

Exemple #1
0
 public function photo(User $user, $args)
 {
     return DataSource::getUserPhoto($user->id, $args['size']);
 }