Class Album

Description

The Album object represents an album.

Albums are identified usign a key, which is a normalized version of the album name. For example, the key for The Dark Side of the Moon is dark_side_of_the_moon.

Located in /music.php (line 359)


	
			
Variable Summary
string $artist_key
string $key
string $name
Method Summary
Album Album (string $album_key, [string $artist_key = NULL])
array albums ()
Album get_album (string $album_key, [string $artist_key = NULL])
string itunes_link ()
string link ([string $text = NULL], [string $stuff = NULL])
string name ()
array tracks ()
array track_ids ()
Variables
Artist $artist (line 383)

The Artist object for the album.

string $artist_key (line 370)

The primary key for the artist.

string $key (line 364)

The primary key for the album.

string $name (line 377)

The name of the album. Use name() to make sure that the album has been initialized.

Methods
Constructor Album (line 394)

Creates an Album object.

Don't call this constructor method directly; instead use:

Album Album (string $album_key, [string $artist_key = NULL])
  • string $album_key: the album key
  • string $artist_key: the artist key
albums (line 465)

If this album has no artist, returns an array of all albums with the same name.

array albums ()
artist (line 452)

The Artist for the album.

  • return: the artist
Artist artist ()
artwork (line 484)

Returns an Artwork object for the album.

  • return: the artwork
Artwork artwork ()
get_album (line 413)

Returns an Album object.

This method uses caching to avoid creating multiple instances of the same album.

If the artist key is not included, the object will represent an abstract album with the given name, such as Greatest Hits. You can call albums() to get an array of concrete albums with that name.

Album get_album (string $album_key, [string $artist_key = NULL])
  • string $album_key: the album key
  • string $artist_key: the artist key
itunes_link (line 566)

Returns a URL to search the iTunes Store for the album.

Searches by artist and album name, unless the album is a compilation

  • return: a URL starting with itms://
string itunes_link ()
link (line 553)

Returns a hyperlink to show the album.

If the link text is not specified, uses the album name.

The link refers to the JavaScript function showAlbum(), as found in the home.php and songs.php pages.

  • return: a link like <a href="javascript:showAlbum('moby','play');">Play</a>
  • see: hyperlink()
string link ([string $text = NULL], [string $stuff = NULL])
  • string $text: the text or image to be linked
  • string $stuff: extra attributes to be included in the tag
name (line 431)

The name of the album.

  • return: the name
string name ()
tracks (line 495)

Returns an array of songs for the album.

Sends add_time_and_size() to each of the songs.

  • return: an array of Songs, indexed by track id
array tracks ()
track_ids (line 525)

Returns an array of track ids for the album.

  • return: an array of integers
array track_ids ()

Documentation generated on Sun, 12 Feb 2006 19:27:53 +0100 by phpDocumentor 1.2.3