Source for file Album.php
Documentation is available at Album.php
/** Represents an album and provides different methods to query album information.
* @package php-lastfm-api
* @author Felix Bruns <felixbruns@web.de>
/** Artist of this album.
/** Create an album object.
* @param mixed $artist An artist object or string.
* @param string $name Name of this album.
* @param integer $id ID of this album.
* @param string $mbid MusicBrainz ID of this album.
* @param string $url Last.fm URL of this album.
* @param array $images An array of cover art images of different sizes.
* @param integer $listeners Number of listeners of this album.
* @param integer $playCount Play count of this album.
* @param integer $releaseDate Release date of this album.
* @param array $topTags An array of top tags of this album.
public function __construct($artist, $name, $id, $mbid, $url, array $images,
$listeners, $playCount, $releaseDate,
parent::__construct($name, $mbid, $url, $images, $listeners, $playCount);
$this->releaseDate =
$releaseDate;
$this->topTags =
$topTags;
/** Returns the artist of this album.
* @return mixed An {@link de.felixbruns.lastfm.Artist Artist} object or the artists name.
/** Returns the ID of this album.
* @return integer The ID of this album.
/** Returns the release date of this album.
* @return integer Release date of this album as a unix timestamp.
return $this->releasedate;
/** Returns the top tags of this album.
* @return array An array of {@link de.felixbruns.lastfm.Tag Tag} objects.
/** Tag an album using a list of user supplied tags.
* @param string $artist The artist name in question. (Required)
* @param string $album The album name in question. (Required)
* @param array $tags An array of user supplied tags to apply to this album. Accepts a maximum of 10 tags. (Required)
* @param Session $session A session obtained by {@link de.felixbruns.lastfm.Auth#getSession Auth::getSession} or {@link de.felixbruns.lastfm.Auth#getMobileSession Auth::getMobileSession}. (Required)
public static function addTags($artist, $album, array $tags,
CallerFactory::getDefaultCaller()->signedCall('album.addTags', array(
'tags' =>
implode(',', $tags)
/** Get the metadata for an album on last.fm using the album name or a MusicBrainz ID. See playlist.fetch on how to get the album playlist.
* @param string $artist The artist name in question. (Optional)
* @param string $album The album name in question. (Optional)
* @param string $mbid The MusicBrainz ID for the album. (Optional)
* @param string $lang The language to return the biography in, expressed as an ISO 639 alpha-2 code. (Optional)
* @return Album An Album object.
public static function getInfo($artist, $album, $mbid =
null, $lang =
null){
/** Get the tags applied by an individual user to an album on last.fm.
* @param string $artist The artist name in question. (Required)
* @param string $album The album name in question. (Required)
* @param Session $session A session obtained by {@link de.felixbruns.lastfm.Auth#getSession Auth::getSession} or {@link de.felixbruns.lastfm.Auth#getMobileSession Auth::getMobileSession}. (Required)
* @return array An array of Tag objects.
public static function getTags($artist, $album, Session $session){
foreach($xml->children() as $tag){
/** Remove a user's tag from an album.
* @param string $artist The artist name in question. (Required)
* @param string $album The album name in question. (Required)
* @param string $tag A single user tag to remove from this album. (Required)
* @param Session $session A session obtained by {@link de.felixbruns.lastfm.Auth#getSession Auth::getSession} or {@link de.felixbruns.lastfm.Auth#getMobileSession Auth::getMobileSession}. (Required)
public static function removeTag($artist, $album, $tag, Session $session){
/** Search for an album by name. Returns album matches sorted by relevance.
* @param string $album The album name in question. (Required)
* @param integer $limit Limit the number of albums 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 PaginatedResult A PaginatedResult object.
public static function search($album, $limit =
null, $page =
null){
foreach($xml->albummatches->children() as $album){
$opensearch =
$xml->children('http://a9.com/-/spec/opensearch/1.1/');
/** Get an album playlist for streaming. INOFFICIAL.
* @param string $artist The artist name in question. (Required)
* @param string $album The album name in question. (Required)
* @return Playlist A Playlist object.
/** Create an Album object from a SimpleXMLElement object.
* @param SimpleXMLElement $xml A SimpleXMLElement object.
* @return Album An Album object.
/* TODO: tagcount | library.getAlbums */
foreach($xml->image as $image){
foreach($xml->toptags->children() as $tag){
if($xml->artist->name &&
$xml->artist->mbid &&
$xml->artist->url){
array(), 0, 0, 0, array(), array(), '', 0.0
if($xml->artist &&
$xml->artist['mbid']){
'', array(), 0, 0, 0, array(), array(), '', 0.0
Documentation generated on Mon, 22 Dec 2008 16:57:27 +0100 by phpDocumentor 1.4.1