diff --git a/Server/Library/Item/Season.php b/Server/Library/Item/Season.php index c1cb50e..b2e92d5 100644 --- a/Server/Library/Item/Season.php +++ b/Server/Library/Item/Season.php @@ -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); + } } diff --git a/Server/Library/Item/Show.php b/Server/Library/Item/Show.php index 49bb85d..71de756 100644 --- a/Server/Library/Item/Show.php +++ b/Server/Library/Item/Show.php @@ -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(