src/lastfmapi/Api/TagApi.php
public function getTopAlbums($methodVars)
    {
        // Check for required variables
        if (!empty($methodVars['tag'])) {
            $vars = array(
                'method' => 'tag.gettopalbums',
                'api_key' => $this->auth->apiKey
            );
            $vars = array_merge($vars, $methodVars);

            if ($call = $this->apiGetCall($vars)) {
                $i = 0;
                foreach ($call->albums->album as $album) {
                    $topAlbums[$i]['name'] = (string) $album->name;
                    $topAlbums[$i]['tagcount'] = (string) $album->tagcount;
                    $topAlbums[$i]['url'] = (string) $album->url;
                    $topAlbums[$i]['artist']['name'] = (string) $album->artist->name;
                    $topAlbums[$i]['artist']['mbid'] = (string) $album->artist->mbid;
                    $topAlbums[$i]['artist']['url'] = (string) $album->artist->url;
                    $topAlbums[$i]['image']['small'] = (string) $album->image[0];
                    $topAlbums[$i]['image']['medium'] = (string) $album->image[1];
                    $topAlbums[$i]['image']['large'] = (string) $album->image[2];
                    $i++;
                }
                return $topAlbums;
            } else {
                return false;
            }
        } else {
            throw new InvalidArgumentException('You must include tag variable in the call for this method');
        }
    }
public function getTopAlbums($methodVars)
    {
        // Check for required variables
        if (!empty($methodVars['tag'])) {
            $vars = array(
                'method' => 'tag.gettopalbums',
                'api_key' => $this->auth->apiKey
            );
            $vars = array_merge($vars, $methodVars);

            if ($call = $this->apiGetCall($vars)) {
                $i = 0;
                foreach ($call->albums->album as $album) {
                    $topAlbums[$i]['name'] = (string) $album->name;
                    $topAlbums[$i]['tagcount'] = (string) $album->tagcount;
                    $topAlbums[$i]['url'] = (string) $album->url;
                    $topAlbums[$i]['artist']['name'] = (string) $album->artist->name;
                    $topAlbums[$i]['artist']['mbid'] = (string) $album->artist->mbid;
                    $topAlbums[$i]['artist']['url'] = (string) $album->artist->url;
                    $topAlbums[$i]['image']['small'] = (string) $album->image[0];
                    $topAlbums[$i]['image']['medium'] = (string) $album->image[1];
                    $topAlbums[$i]['image']['large'] = (string) $album->image[2];
                    $i++;
                }
                return $topAlbums;
            } else {
                return false;
            }
        } else {
            throw new InvalidArgumentException('You must include tag variable in the call for this method');
        }
    }
public function getTopAlbums ( $ methodVars ) { // Check for required variables if ( ! empty ( $ methodVars [ 'tag' ] ) ) { $ vars = array ( 'method' => 'tag.gettopalbums' , 'api_key' => $ this -> auth -> apiKey ) ; $ vars = array_merge ( $ vars , $ methodVars ) ; if ( $ call = $ this -> apiGetCall ( $ vars ) ) { $ i = 0 ; foreach ( $ call -> albums -> album as $ album ) { $ topAlbums [ $ i ] [ 'name' ] = ( string ) $ album -> name ; $ topAlbums [ $ i ] [ 'tagcount' ] = ( string ) $ album -> tagcount ; $ topAlbums [ $ i ] [ 'url' ] = ( string ) $ album -> url ; $ topAlbums [ $ i ] [ 'artist' ] [ 'name' ] = ( string ) $ album -> artist -> name ; $ topAlbums [ $ i ] [ 'artist' ] [ 'mbid' ] = ( string ) $ album -> artist -> mbid ; $ topAlbums [ $ i ] [ 'artist' ] [ 'url' ] = ( string ) $ album -> artist -> url ; $ topAlbums [ $ i ] [ 'image' ] [ 'small' ] = ( string ) $ album -> image [ 0 ] ; $ topAlbums [ $ i ] [ 'image' ] [ 'medium' ] = ( string ) $ album -> image [ 1 ] ; $ topAlbums [ $ i ] [ 'image' ] [ 'large' ] = ( string ) $ album -> image [ 2 ] ; $ i ++ ; } return $ topAlbums ; } else { return false ; } } else { throw new InvalidArgumentException ( 'You must include tag variable in the call for this method' ) ; } }
Get the top albums tagged by this tag, ordered by tag count
@param array $methodVars An array with the following required values: <i>tag</i>
@return array
Get the top albums tagged by this tag ordered by tag count