src/lastfmapi/Api/TrackApi.php
public function getTopTags($methodVars) {
		// Check for required variables
		if ( !empty($methodVars['artist']) && !empty($methodVars['track']) ) {
			$vars = array(
				'method' => 'track.gettoptags',
				'api_key' => $this->auth->apiKey
			);
			$vars = array_merge($vars, $methodVars);

			if ( $call = $this->apiGetCall($vars) ) {
				if ( count($call->toptags->tag) > 0 ) {
					$topTags['artist'] = (string) $call->toptags['artist'];
					$topTags['track'] = (string) $call->toptags['track'];
					$i = 0;
					foreach ( $call->toptags->tag as $tag ) {
						$topTags['tags'][$i]['name'] = (string) $tag->name;
						$topTags['tags'][$i]['count'] = (string) $tag->count;
						$topTags['tags'][$i]['url'] = (string) $tag->url;
						$i++;
					}
					return $topTags;
				}
				else {
					throw new NoResultsException('This track has no tags');
				}
			}
			else {
				return false;
			}
		}
		else {
			throw new InvalidArgumentException('You must include artist and track varialbes in the call for this method');
		}
	}
public function getTopTags($methodVars) {
		// Check for required variables
		if ( !empty($methodVars['artist']) && !empty($methodVars['track']) ) {
			$vars = array(
				'method' => 'track.gettoptags',
				'api_key' => $this->auth->apiKey
			);
			$vars = array_merge($vars, $methodVars);

			if ( $call = $this->apiGetCall($vars) ) {
				if ( count($call->toptags->tag) > 0 ) {
					$topTags['artist'] = (string) $call->toptags['artist'];
					$topTags['track'] = (string) $call->toptags['track'];
					$i = 0;
					foreach ( $call->toptags->tag as $tag ) {
						$topTags['tags'][$i]['name'] = (string) $tag->name;
						$topTags['tags'][$i]['count'] = (string) $tag->count;
						$topTags['tags'][$i]['url'] = (string) $tag->url;
						$i++;
					}
					return $topTags;
				}
				else {
					throw new NoResultsException('This track has no tags');
				}
			}
			else {
				return false;
			}
		}
		else {
			throw new InvalidArgumentException('You must include artist and track varialbes in the call for this method');
		}
	}
public function getTopTags ( $ methodVars ) { // Check for required variables
 if ( ! empty ( $ methodVars [ 'artist' ] ) && ! empty ( $ methodVars [ 'track' ] ) ) { $ vars = array ( 'method' => 'track.gettoptags' , 'api_key' => $ this -> auth -> apiKey ) ; $ vars = array_merge ( $ vars , $ methodVars ) ; if ( $ call = $ this -> apiGetCall ( $ vars ) ) { if ( count ( $ call -> toptags -> tag ) > 0 ) { $ topTags [ 'artist' ] = ( string ) $ call -> toptags [ 'artist' ] ; $ topTags [ 'track' ] = ( string ) $ call -> toptags [ 'track' ] ; $ i = 0 ; foreach ( $ call -> toptags -> tag as $ tag ) { $ topTags [ 'tags' ] [ $ i ] [ 'name' ] = ( string ) $ tag -> name ; $ topTags [ 'tags' ] [ $ i ] [ 'count' ] = ( string ) $ tag -> count ; $ topTags [ 'tags' ] [ $ i ] [ 'url' ] = ( string ) $ tag -> url ; $ i ++ ; } return $ topTags ; } else { throw new NoResultsException ( 'This track has no tags' ) ; } } else { return false ; } } else { throw new InvalidArgumentException ( 'You must include artist and track varialbes in the call for this method' ) ; } }
Get the top tags for this track on Last.fm, ordered by tag count
@param array $methodVars An array with the following required values: <i>artist</i>, <i>track</i>
@return array
Get the top tags for this track on Last . fm ordered by tag count