src/lastfmapi/Api/AlbumApi.php
public function getTags($methodVars)
    {
        // Only allow full authed calls
        if ($this->getFullAuth() === true) {
            // Check for required variables
            if (!empty($methodVars['album']) && !empty($methodVars['artist'])) {
                // Set the variables
                $vars = array(
                    'method' => 'album.gettags',
                    'api_key' => $this->getAuth()->apiKey,
                    'sk' => $this->getAuth()->sessionKey
                );
                $vars = array_merge($vars, $methodVars);

                // Generate a call signiture
                $sig = $this->apiSig($this->getAuth()->apiSecret, $vars);
                $vars['api_sig'] = $sig;

                $tags = array();
                // Make the call
                if ($call = $this->apiGetCall($vars)) {
                    if (count($call->tags->tag) > 0) {
                        $i = 0;
                        foreach ($call->tags->tag as $tag) {
                            $tags[$i]['name'] = (string) $tag->name;
                            $tags[$i]['url'] = (string) $tag->url;
                            $i++;
                        }

                        return $tags;
                    } else {
                        throw new NoResultsException('User has no tags for this artist');
                    }
                } else {
                    return false;
                }
            } else {
                throw new InvalidArgumentException('You must include album, artist and tags variables in the call for this method');
            }
        } else {
            throw new NotAuthenticatedException('Method requires full auth. Call auth.getSession using lastfmApiAuth class');
        }
    }
public function getTags($methodVars)
    {
        // Only allow full authed calls
        if ($this->getFullAuth() === true) {
            // Check for required variables
            if (!empty($methodVars['album']) && !empty($methodVars['artist'])) {
                // Set the variables
                $vars = array(
                    'method' => 'album.gettags',
                    'api_key' => $this->getAuth()->apiKey,
                    'sk' => $this->getAuth()->sessionKey
                );
                $vars = array_merge($vars, $methodVars);

                // Generate a call signiture
                $sig = $this->apiSig($this->getAuth()->apiSecret, $vars);
                $vars['api_sig'] = $sig;

                $tags = array();
                // Make the call
                if ($call = $this->apiGetCall($vars)) {
                    if (count($call->tags->tag) > 0) {
                        $i = 0;
                        foreach ($call->tags->tag as $tag) {
                            $tags[$i]['name'] = (string) $tag->name;
                            $tags[$i]['url'] = (string) $tag->url;
                            $i++;
                        }

                        return $tags;
                    } else {
                        throw new NoResultsException('User has no tags for this artist');
                    }
                } else {
                    return false;
                }
            } else {
                throw new InvalidArgumentException('You must include album, artist and tags variables in the call for this method');
            }
        } else {
            throw new NotAuthenticatedException('Method requires full auth. Call auth.getSession using lastfmApiAuth class');
        }
    }
public function getTags ( $ methodVars ) { // Only allow full authed calls if ( $ this -> getFullAuth ( ) === true ) { // Check for required variables if ( ! empty ( $ methodVars [ 'album' ] ) && ! empty ( $ methodVars [ 'artist' ] ) ) { // Set the variables $ vars = array ( 'method' => 'album.gettags' , 'api_key' => $ this -> getAuth ( ) -> apiKey , 'sk' => $ this -> getAuth ( ) -> sessionKey ) ; $ vars = array_merge ( $ vars , $ methodVars ) ; // Generate a call signiture $ sig = $ this -> apiSig ( $ this -> getAuth ( ) -> apiSecret , $ vars ) ; $ vars [ 'api_sig' ] = $ sig ; $ tags = array ( ) ; // Make the call if ( $ call = $ this -> apiGetCall ( $ vars ) ) { if ( count ( $ call -> tags -> tag ) > 0 ) { $ i = 0 ; foreach ( $ call -> tags -> tag as $ tag ) { $ tags [ $ i ] [ 'name' ] = ( string ) $ tag -> name ; $ tags [ $ i ] [ 'url' ] = ( string ) $ tag -> url ; $ i ++ ; } return $ tags ; } else { throw new NoResultsException ( 'User has no tags for this artist' ) ; } } else { return false ; } } else { throw new InvalidArgumentException ( 'You must include album, artist and tags variables in the call for this method' ) ; } } else { throw new NotAuthenticatedException ( 'Method requires full auth. Call auth.getSession using lastfmApiAuth class' ) ; } }
Get the tags applied by an individual user to an album on Last.fm
@param array $methodVars An array with the following required values: <i>album</i>, <i>artist</i>
@return array
Get the tags applied by an individual user to an album on Last . fm