Class Tag

Description

Represents a tag and provides different methods to query tag information.

Located in /src/Tag.php (line 9)


	
			
Method Summary
static Tag fromSimpleXMLElement ( $xml)
static array getSimilar (string $tag)
static array getTopAlbums (string $tag)
static array getTopArtists (string $tag)
static array getTopTags ()
static array getTopTracks (string $tag)
static array getWeeklyArtistChart (string $tag, [integer $from = null], [integer $to = null], [integer $limit = null])
static array getWeeklyChartList (string $tag)
static array search (string $tag, [integer $limit = null], [integer $page = null])
Tag __construct (string $name, integer $count, string $url)
integer getCount ()
string getName ()
string getUrl ()
Methods
static method fromSimpleXMLElement (line 276)

Create a Tag object from a SimpleXMLElement.

  • return: A Tag object.
  • access: public
static Tag fromSimpleXMLElement ( $xml)
  • SimpleXMLElement $xml: A SimpleXMLElement.
static method getSimilar (line 81)

Search for tags similar to this one. Returns tags ranked by similarity, based on listening data.

  • return: An array of Tag objects.
  • throws: Error
  • access: public
static array getSimilar (string $tag)
  • string $tag: The tag name in question. (Required)
static method getTopAlbums (line 104)

Get the top albums tagged by this tag, ordered by tag count.

  • return: An array of Album objects.
  • throws: Error
  • access: public
static array getTopAlbums (string $tag)
  • string $tag: The tag name in question. (Required)
static method getTopArtists (line 127)

Get the top artists tagged by this tag, ordered by tag count.

  • return: An array of Artist objects.
  • throws: Error
  • access: public
static array getTopArtists (string $tag)
  • string $tag: The tag name in question. (Required)
static method getTopTags (line 149)

Fetches the top global tags on last.fm, sorted by popularity (number of times used).

  • return: An array of Tag objects.
  • throws: Error
  • access: public
static array getTopTags ()
static method getTopTracks (line 170)

Get the top tracks tagged by this tag, ordered by tag count.

  • return: An array of Track objects.
  • throws: Error
  • access: public
static array getTopTracks (string $tag)
  • string $tag: The tag name in question. (Required)
static method getWeeklyArtistChart (line 196)

Get an artist chart for a tag, for a given date range. If no date range is supplied, it will return the most recent artist chart for this tag.

  • return: An array of Artist objects.
  • throws: Error
  • access: public
static array getWeeklyArtistChart (string $tag, [integer $from = null], [integer $to = null], [integer $limit = null])
  • string $tag: The tag name in question. (Required)
  • integer $from: The date at which the chart should start from. See Tag.getWeeklyChartList for more. (Optional)
  • integer $to: The date at which the chart should end on. See Tag.getWeeklyChartList for more. (Optional)
  • integer $limit: The number of chart items to return (default = 50). (Optional)
static method getWeeklyChartList (line 223)

Get a list of available charts for this group, expressed as date ranges which can be sent to the chart services.

  • return: An array of from/to unix timestamp pairs.
  • throws: Error
  • access: public
static array getWeeklyChartList (string $tag)
  • string $tag: The tag name in question. (Required)
static method search (line 251)

Search for a tag by name. Returns matches sorted by relevance.

  • return: An array of Tag objects.
  • throws: Error
  • access: public
static array search (string $tag, [integer $limit = null], [integer $page = null])
  • string $tag: The tag name in question. (Required)
  • integer $limit: Limit the number of tags returned at one time. Default (maximum) is 30. (Optional)
  • integer $page: Scan into the results by specifying a page number. Defaults to first page. (Optional)
Constructor __construct (line 39)

Create a Tag object.

  • access: public
Tag __construct (string $name, integer $count, string $url)
  • string $name: Tag name.
  • integer $count: Tag count.
  • string $url: Tag URL.
getCount (line 59)

Returns the tags count.

  • return: Tag count.
  • access: public
integer getCount ()
getName (line 50)

Returns the tags name.

  • return: Tag name.
  • access: public
string getName ()
getUrl (line 68)

Returns the tags last.fm URL.

  • return: Tag URL.
  • access: public
string getUrl ()

Documentation generated on Mon, 22 Dec 2008 16:57:45 +0100 by phpDocumentor 1.4.1