Source for file Tag.php
Documentation is available at Tag.php
/** Represents a tag and provides different methods to query tag information.
* @package php-lastfm-api
* @author Felix Bruns <felixbruns@web.de>
/** The tags last.fm URL.
* @param string $name Tag name.
* @param integer $count Tag count.
* @param string $url Tag URL.
/** Returns the tags name.
* @return string Tag name.
/** Returns the tags count.
* @return integer Tag count.
/** Returns the tags last.fm URL.
* @return string Tag URL.
/** Search for tags similar to this one. Returns tags ranked by similarity, based on listening data.
* @param string $tag The tag name in question. (Required)
* @return array An array of Tag objects.
foreach($xml->children() as $tag){
/** Get the top albums tagged by this tag, ordered by tag count.
* @param string $tag The tag name in question. (Required)
* @return array An array of Album objects.
foreach($xml->children() as $album){
/** Get the top artists tagged by this tag, ordered by tag count.
* @param string $tag The tag name in question. (Required)
* @return array An array of Artist objects.
foreach($xml->children() as $artist){
/** Fetches the top global tags on last.fm, sorted by popularity (number of times used).
* @return array An array of Tag objects.
foreach($xml->children() as $tag){
/** Get the top tracks tagged by this tag, ordered by tag count.
* @param string $tag The tag name in question. (Required)
* @return array An array of Track objects.
foreach($xml->children() as $track){
/** 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.
* @param string $tag The tag name in question. (Required)
* @param integer $from The date at which the chart should start from. See Tag.getWeeklyChartList for more. (Optional)
* @param integer $to The date at which the chart should end on. See Tag.getWeeklyChartList for more. (Optional)
* @param integer $limit The number of chart items to return (default = 50). (Optional)
* @return array An array of Artist objects.
foreach($xml->children() as $artist){
/** Get a list of available charts for this group, expressed as date ranges which can be sent to the chart services.
* @param string $tag The tag name in question. (Required)
* @return array An array of from/to unix timestamp pairs.
foreach($xml->children() as $chart){
/** Search for a tag by name. Returns matches sorted by relevance.
* @param string $tag The tag name in question. (Required)
* @param integer $limit Limit the number of tags returned at one time. Default (maximum) is 30. (Optional)
* @param integer $page Scan into the results by specifying a page number. Defaults to first page. (Optional)
* @return array An array of Tag objects.
public static function search($tag, $limit =
null, $page =
null){
foreach($xml->tagmatches->children() as $tag){
/** Create a Tag object from a SimpleXMLElement.
* @param SimpleXMLElement $xml A SimpleXMLElement.
* @return Tag A Tag object.
Documentation generated on Mon, 22 Dec 2008 16:57:45 +0100 by phpDocumentor 1.4.1