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 episode retrieval to the season class and f…
Browse files Browse the repository at this point in the history
…ixed some comments in the show class.
  • Loading branch information
nickbart committed Dec 25, 2012
1 parent 23e4920 commit 16e0714
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
31 changes: 31 additions & 0 deletions Server/Library/Item/Season.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 episode objects for the intstantiated season.
*
* @uses Plex_Server_Library::getItems()
* @uses Plex_Server_Library_ItemAbstract::buildChildrenEndpoint()
*
* @return Plex_Server_Library_Item_Episode[] An array of Plex library
* episodes objects.
*/
public function getEpisodes()
{
return $this->getItems(
$this->buildChildrenEndpoint()
);
}

/**
* Returns a single episode 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 episode.
*
* @uses Plex_Server_Library_ItemAbstract::getPolymorphicItem()
*
* @return Plex_Server_Library_Item_Episode A single episode.
*/
public function getEpisode($polymorphicData)
{
return $this->getPolymorphicItem($polymorphicData);
}
}
4 changes: 2 additions & 2 deletions Server/Library/Item/Show.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ public function setAttributes($attribute)
* @uses Plex_Server_Library::getItems()
* @uses Plex_Server_Library_ItemAbstract::buildChildrenEndpoint()
*
* @return Plex_Server_Library_ItemSeason[] An array of Plex library season
* @return Plex_Server_Library_Item_Season[] An array of Plex library season
* objects.
*/
*/
public function getSeasons()
{
return $this->getItems(
Expand Down

0 comments on commit 16e0714

Please sign in to comment.