Class Playlist

Description

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

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


	
			
Method Summary
static void addTrack (string $id, string $artist, string $track, Session $session)
static Playlist create ([string $title = null], [string $description = null], Session $session)
static Playlist fetch (string $playlist, [string $streaming = null], [string $fod = null], [Session $session = null])
static Playlist fromSimpleXMLElement ( $xml)
Playlist __construct (integer $id, string $title, string $annotation, string $creator, integer $date,  $tracks, integer $size, boolean $streamable, array $track)
string getAnnotation ()
string getCreator ()
integer getDate ()
integer getId ()
integer getSize ()
string getTitle ()
Track getTrack (integer $index)
array getTracks ()
boolean isStreamable ()
Methods
static method addTrack (line 184)

Add a track to a last.fm user's playlist.

  • throws: Error
  • access: public
static void addTrack (string $id, string $artist, string $track, Session $session)
  • string $id: The ID of the playlist - this is available in user.getPlaylists. (Required)
  • string $artist: The artist name that corresponds to the track to be added. (Required)
  • string $track: The track name to add to the playlist. (Required)
  • Session $session: A session obtained by getSession or getMobileSession. (Required)
static method create (line 203)

Create a last.fm playlist on behalf of a user.

  • return: A Playlist object.
  • throws: Error
  • access: public
static Playlist create ([string $title = null], [string $description = null], Session $session)
  • string $title: Title for the playlist. (Optional)
  • string $description: Description for the playlist. (Optional)
  • Session $session: A session obtained by getSession or getMobileSession. (Required)
static method fetch (line 224)

Fetch XSPF playlists using a last.fm playlist url.

  • return: A Playlist object.
  • throws: Error
  • access: public
static Playlist fetch (string $playlist, [string $streaming = null], [string $fod = null], [Session $session = null])
  • string $playlist: A lastfm protocol playlist url ('lastfm://playlist/...'). (Required)
  • string $streaming: Weather to fetch a playlist for streaming. (Optional)
  • string $fod: Weather to fetch a playlist with free on demand tracks. (Optional)
  • Session $session: A session obtained by getSession or getMobileSession. (Optional)
static method fromSimpleXMLElement (line 253)

Create a Playlist object from a SimpleXMLElement.

  • return: A Playlist object.
  • access: public
static Playlist fromSimpleXMLElement ( $xml)
  • SimpleXMLElement $xml: A SimpleXMLElement object.
Constructor __construct (line 79)

Create a playlist object.

  • access: public
Playlist __construct (integer $id, string $title, string $annotation, string $creator, integer $date,  $tracks, integer $size, boolean $streamable, array $track)
  • integer $id: Playlist id.
  • string $title: Playlist tile.
  • string $annotation: Playlist annotation.
  • string $creator: Playlist creator.
  • integer $date: Playlist date (unix timestamp).
  • array $track: An array of Track objects.
  • integer $size: Playlist size.
  • boolean $streamable: Playlist is streamable.
  • array $tracks
getAnnotation (line 114)

Returns the annotation of this playlist.

  • return: A playlist annotation.
  • access: public
string getAnnotation ()
getCreator (line 123)

Returns the creator of this playlist.

  • return: A playlist creator.
  • access: public
string getCreator ()
getDate (line 132)

Returns the date of this playlist.

  • return: A playlist date (unix timestamp).
  • access: public
integer getDate ()
getId (line 96)

Returns the ID of this playlist.

  • return: A playlist id.
  • access: public
integer getId ()
getSize (line 160)

Returns the size of this playlist.

  • return: A playlist size.
  • access: public
integer getSize ()
getTitle (line 105)

Returns the title of this playlist.

  • return: A playlist title.
  • access: public
string getTitle ()
getTrack (line 151)

Returns a track of this playlist.

  • return: A Track object.
  • access: public
Track getTrack (integer $index)
  • integer $index: Track index.
getTracks (line 141)

Returns an array of tracks of this playlist.

  • return: An array of Track objects.
  • access: public
array getTracks ()
isStreamable (line 169)

Returns if the playlist is streamable.

  • return: Playlist is streamable.
  • access: public
boolean isStreamable ()

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