Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Commit

Permalink
Added single and multiple album retrieval to the atist item object.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickbart committed Dec 25, 2012
1 parent 16e0714 commit b7153e1
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Server/Library/Item/Artist.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,35 @@ public function setAttributes($attribute)
{
parent::setAttributes($attribute);
}

/**
* Returns an array of all the albumn objects for the intstantiated artist.
*
* @uses Plex_Server_Library::getItems()
* @uses Plex_Server_Library_ItemAbstract::buildChildrenEndpoint()
*
* @return Plex_Server_Library_Item_Album[] An array of Plex library album
* objects.
*/
public function getAlbums()
{
return $this->getItems(
$this->buildChildrenEndpoint()
);
}

/**
* Returns a single album by index, key, or exact title match.
*
* @param integer|string $polymorphicData Either an index, a key, or a title
* for an exact title match that will be used to retrieve a single album.
*
* @uses Plex_Server_Library_ItemAbstract::getPolymorphicItem()
*
* @return Plex_Server_Library_Item_Album A single album.
*/
public function getAlbum($polymorphicData)
{
return $this->getPolymorphicItem($polymorphicData);
}
}

0 comments on commit b7153e1

Please sign in to comment.