From 6a6f2b53318e8ff964b3c1ba8da13e9ae20c2718 Mon Sep 17 00:00:00 2001 From: Nick Bartkowiak Date: Mon, 17 Dec 2012 10:44:20 -0600 Subject: [PATCH] Updated the library class to work with the new tiered sections. --- Server/Library.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Server/Library.php b/Server/Library.php index 13505b9..21d15a8 100644 --- a/Server/Library.php +++ b/Server/Library.php @@ -107,7 +107,7 @@ protected function buildUrl($endpoint) * * @uses Plex_MachineAbstract::makeCall() * @uses Plex_Server_Library::buildUrl() - * @uses Plex_Server_Library_Item::factory() + * @uses Plex_Server_Library_ItemAbstract::factory() * @uses Plex_Server_Library_ItemInterface::setAttributes() * * return Plex_Server_Library_Item[] An array of plex library items. @@ -118,11 +118,12 @@ protected function getItems($endpoint) $itemArray = $this->makeCall($this->buildUrl($endpoint)); foreach ($itemArray as $attribute) { - $item = Plex_Server_Library_Item::factory($attribute['type']); + $item = Plex_Server_Library_ItemAbstract::factory( + $attribute['type'] + ); $item->setAttributes($attribute); $items[] = $item; } - return $items; } @@ -133,12 +134,11 @@ protected function getItems($endpoint) * @uses Plex_MachineAbstract::$name * @uses Plex_MachineAbstract::$address * @uses Plex_MachineAbstract::$port - * @uses Plex_MachineAbstract::getBaseUrl() * @uses Plex_MachineAbstract::makeCall() - * @uses Plex_MachineAbstract::xmlAttributesToArray() - * @uses Plex_Server_Library::ENDPOINT_LIBRARY * @uses Plex_Server_Library::ENDPOINT_SECTION - * @uses Plex_Server_Library_Section::setAttributes() + * @uses Plex_Server_Library::buildUrl() + * @uses Plex_Server_Library_SectionAbstract::factory() + * @uses Plex_Server_Library_SectionAbstract::setAttributes() * * @return Plex_Server_Library_Section[] An array of user defined Plex * library sections. @@ -151,7 +151,8 @@ public function getSections() ); foreach ($sectionArray as $attribute) { - $section = new Plex_Server_Library_Section( + $section = Plex_Server_Library_SectionAbstract::factory( + $attribute['type'], $this->name, $this->address, $this->port