abstract class Plex_Server_Library_ItemAbstract extends Plex_Server_Library_SectionAbstract implements Plex_Server_Library_ItemInterface

Base class that helps define a Plex library item with all the generic methods and member shared by all Plex library items.

Constants

DEFAULT_ADDRESS

The default address on which a Plex server listens.

DEFAULT_PORT

The default port on which a Plex server listens.

ENDPOINT_CLIENT

The Plex HTTP API endpoint for client listing.

ENDPOINT_LIBRARY

URL endpoint for Plex server library.

ENDPOINT_SECTION

URL endpoint for library sections.

ENDPOINT_RECENTLY_ADDED

URL endpoint for a library's recently added items.

ENDPOINT_ON_DECK

URL endpoint for a library's on deck items.

ENDPOINT_METADATA

URL endpoint for single library items.

TYPE_MOVIE

String that identifies a Plex library movie item type.

TYPE_ARTIST

String that identifies a Plex library artist item type.

TYPE_ALBUM

String that identifies a Plex library album item type.

TYPE_TRACK

String that identifies a Plex library track item type.

TYPE_PHOTO

String that identifies a Plex library photo item type.

TYPE_SHOW

String that identifies a Plex library TV show item type.

TYPE_SEASON

String that identifies a Plex library TV season item type.

TYPE_EPISODE

String that identifies a Plex library episode item type.

ENDPOINT_CATEGORY_ALL

Endpoint for retrieving all items for a section.

ENDPOINT_CATEGORY_UNWATCHED

Endpoint for retrieving all unwatched items for a section.

ENDPOINT_CATEGORY_NEWEST

Endpoint for retrieving the newest items for a section.

ENDPOINT_CATEGORY_RECENTLY_ADDED

Endpoint for retrieving recently added items for a section.

ENDPOINT_CATEGORY_RECENTLY_VIEWED

Endpoint for retrieving recently viewed items for a section.

ENDPOINT_CATEGORY_ON_DECK

Endpoint for retrieving on deck items for a section.

ENDPOINT_CATEGORY_COLLECTION

Endpoint for retrieving items for a section by collection.

ENDPOINT_CATEGORY_FIRST_CHARACTER

Endpoint for retrieving items for a section by first character.

ENDPOINT_CATEGORY_GENRE

Endpoint for retrieving items for a section by genre.

ENDPOINT_CATEGORY_YEAR

Endpoint for retrieving items for a section by year.

ENDPOINT_CATEGORY_CONTENT_RATING

Endpoint for retrieving shows by content rating.

ENDPOINT_SEARCH

Endpoint for searching a section for items.

SEARCH_TYPE_MOVIE

Parameter for searching movies.

SEARCH_TYPE_SHOW

Parameter for searching television shows.

SEARCH_TYPE_EPISODE

Parameter for searching television episodes.

SEARCH_TYPE_ARTIST

Parameter for searching artists.

SEARCH_TYPE_TRACK

Parameter for searching tracks.

ENDPOINT_CHILDREN

Endpoint for listing the child items of a parent or grandparent item.

ENDPOINT_ALL_LEAVES

Endpoint for listing all the grandchild items of an item.

Properties

protected string $name The name of the Plex machine on the network. from Plex_MachineAbstract
protected string $address The IP address of the Plex machine on the network. from Plex_MachineAbstract
protected integer $port The port on which the Plex machine is listening. Typically 32400 for servers and 3000 for clients. from Plex_MachineAbstract
protected string $token The token of the Plex machine on the network. from Plex_MachineAbstract
protected string $art Reference to the art section's art. from Plex_Server_Library_SectionAbstract
protected boolean $refreshing Boolean saying whether or not the section is currently refreshing. from Plex_Server_Library_SectionAbstract
protected string $key Key/path to specifically identify the the single item.
protected string $type Type of the item.
protected string $title Title of the item.
protected string $agent The metadata agent for the section. from Plex_Server_Library_SectionAbstract
protected string $scanner The type of scanner for the section. from Plex_Server_Library_SectionAbstract
protected string $language The section's language. from Plex_Server_Library_SectionAbstract
protected string $uuid Universally unique identifier for the section. from Plex_Server_Library_SectionAbstract
protected DateTime $updatedAt Date the item was last updated.
protected DateTime $createdAt Date the section was created. from Plex_Server_Library_SectionAbstract
protected boolean $allowSync Whether or not the item is available for sync.
protected integer $librarySectionId The ID of the library section to which the item belongs.
protected integer $ratingKey Unique integer that represents an item and helps build its key string.
protected string $titleSort Sorting title of the item. This is used if the item's title starts with "The," "An," or "A."
protected string $summary Summary of the item.
protected integer $index Index of the item.
protected string $thumb Reference to the thumb of the item.
protected DateTime $addedAt Date the item was added to the library.
protected integer $viewCount The number of times the item has been viewed.
protected Plex_Server_Library_Item_Media $media The media info associated with a Plex item.
protected Plex_Server_Library_Item_Tag[] $genres The genres info associated with a Plex item.
protected Plex_Server_Library_Item_Tag $director The director info associated with a Plex item.
protected Plex_Server_Library_Item_Tag $writer The writer info associated with a Plex item.
protected Plex_Server_Library_Item_Tag $producer The producer info associated with a Plex item.
protected Plex_Server_Library_Item_Tag $country The country info associated with a Plex item.
protected Plex_Server_Library_Item_Tag[] $roles The roles info associated with a Plex item.

Methods

string
getBaseUrl()

Returns the base URL, which will be standard for all requests made to the Plex machine.

array
xmlAttributesToArray(SimpleXMLElement $xml, integer $pass = 0)

Typically the useful data returned by a Plex machine will containted in XML attributes. This allows a set of XML nodes to be passed and all the attribues extracted and returned as an associated array.

array
makeCall(string $url)

Utilizes php-curl to send a request to the passed URL and returns an XML document reprentation of the returned content.

string
getCallingFunction(integer $depth = 2)

Universal function so any method belonging to a child class of a Plex machine can discover which function called it. This is used mainly for some of our polymorphic requests as the calling function can tell us what type of item is being requested.

void
__construct(string $name, string $address, integer $port, string $token)

Sets up our Plex server using the minimum amount of data required to interact.

getClients()

Returns all the available clients to which the Plex server has access indexed by the Plex client name.

getLibrary()

Returns the Plex library belonging to the instantiated Plex server.

string
getName()

Returns the Plex server's name.

string
getAddress()

Returns the Plex server's IP address.

integer
getPort()

Returns the port on which the Plex server listens.

string
getToken()

Returns the token on which the Plex machine listens.

string
buildUrl(string $endpoint)

Generic way of building a url agains the Plex library.

mixed[]
getItems(string $endpoint)

Generic way of requesting Plex library items.

string
functionToType($function)

Given a function name, uses that name to decide what Plex library item item type with which the function is associated. This is useful when trying to polymorphically request items because we can use the calling function to abstractly identify what type of item with which we are dealing.

mixed[]
getSections()

Returns an array of user defined Plex library sections that can be used to interact with the items contained within.

mixed
getSectionByKey(integer $key) deprecated

Returns a Plex library section by its given key. Here we simply run self::getSections() because the endpoint /library/sections/ID does not return full section data, it returns the categories below the section.

mixed
getSection(integer|string $polymorphicData)

Returns a Plex library section by its given key or by a exact match on title. Here we simply run self::getSections() because the endpoint /library/sections/ID does not return full section data, it returns the categories below the section.

mixed[]
getRecentlyAddedItems()

Returns the recently added items at the library level.

mixed[]
getOnDeckItems()

Returns the on deck items at the library level.

void
setAttributes(array $attribute)

Sets an array of attributes, if they exist, to the corresponding class member.

string
buildEndpoint(string $endpoint)

Generic method for building a Plex library section endpoint.

string
buildSearchEndpoint(integer $type, string $query)

Builds an endpoint to search a Plex library section.

getAllItems()

Generic method allowing a child class to retrieve all items for its section.

getUnwatchedItems()

Generic method allowing a child class to retrieve all unwatched items for its section.

getNewestItems()

Generic method allowing a child class to retrieve the newest items for its section.

getRecentlyAddedSectionItems()

Generic method allowing a child class to retrieve recently added items for its section. It is named slightly differently as it collided with the library method of the same name.

getOnDeckSectionItems()

Generic method allowing a child class to retrieve the on deck items for its section. It is named slightly differently as it collided with the library method of the same name.

getRecentlyViewedItems()

Generic method allowing a child class to retrieve recently viewed items for its section.

getItemsByCollection(integer $collectionKey)

Generic method allowing a child class to retrieve recently viewed items for its section.

getItemsByFirstCharacter(string $character)

Generic method allowing a child class to retrieve items by first character from its section.

getItemsByGenre(integer $genreKey)

Generic method allowing a child class to retrieve items by genre from its section.

getItemsByYear(integer $year)

Generic method allowing a child class to retrieve items by four digit year from its section

getPolymorphicItem(integer|string $polymorphicData, boolean $scopedToItem = FALSE)

Override of the section version of this method so we can apply slightly different rules when retrieving single children and grandchildren at the item level.

array
getFirstCharacters()

Returns a list with first letter of title, key and size for the child class's section. We use makeCall directly here, because we want to return just the raw array of caracters and not do any post processing on it.

array
getAlphabet()

Returns a list of alphanumeric of first letter for the child class's section.

array
getCollections()

Returns a list of collections for the child class's section. We use makeCall directly here, because we want to return just the raw array of collections and not do any post processing on it.

array
getGenres()

Returns the genres info of the item.

factory(string $type, string $name, string $address, integer $port, string $token)

Static factory method used to instantiate child item classes by their type.

string
getArt()

Returns a reference to the section's art.

void
setArt(string $art)

Sets a reference to the section's art.

boolean
isRefreshing()

Tells whether the section is currently in the process of refreshing.

void
setRefreshing(boolean $refreshing)

Sets whether the section is currently in the process of refreshing.

integer
getKey()

Returns the key of the item.

void
setKey(integer $key)

Sets the key of the item.

string
getType()

Returns the type of the item.

void
setType(string $type)

Sets the type of the item.

string
getTitle()

Returns the title of the item.

void
setTitle(string $title)

Sets the title of the item.

string
getAgent()

Returns the section's agent.

void
setAgent(string $agent)

Sets the section's agent.

string
getScanner()

Returns the section's scanner

void
setScanner(string $scanner)

Sets the section's scanner

string
getLanguage()

Returns the section's language.

void
setLanguage(string $language)

Sets the section's language.

string
getUuid()

Returns the section's universally unique identifier.

void
setUuid(string $uuid)

Sets the section's universally unique identifier.

getUpdatedAt()

Returns the time at which the item was last updated.

void
setUpdatedAt(integer $updatedAtTs)

Sets the time at which the item was last updated.

getCreatedAt()

Returns the time at which the section was created.

void
setCreatedAt(integer $createdAtTs)

Sets the time at which the section was last created.

getItemByIndex(integer $index)

Returns a single item by its index.

string
buildChildrenEndpoint()

Builds an endpoint for an item to retrieve its children and grandchildren items.

string
buildAllLeavesEndpoint()

Builds an endpoint for an item to retrieve all of its grandchildren.

string
buildUrlThumb()

Build a url with access to the thumbnail image.

boolean
doesAllowSync()

Says whether or not the item is available for sync.

void
setAllowSync(boolean $allowSync)

Sets whether or not the item is available for sync.

int
getLibrarySectionId()

Return library section ID to which the item belongs.

void
setLibrarySectionId(int $librarySectionId)

Sets the library section ID to which the item belongs.

int
getRatingKey()

Returns the rating key of the item.

void
setRatingKey(int $ratingKey)

Sets the rating key of the item.

string
getTitleSort()

Returns the sort title of the item.

void
setTitleSort(string $titleSort)

Sets the sort title of the item.

string
getSummary()

Returns the summary of the item.

void
setSummary(string $summary)

Sets the summary of the item.

int
getIndex()

Returns the index of the item.

void
setIndex(int $index)

Sets the index of the item.

string
getThumb()

Returns the thumb reference of the item.

void
setThumb(string $thumb)

Sets the thumb reference of the item.

getAddedAt()

Returns the time at which the item was added.

void
setAddedAt(integer $addedAtTs)

Sets the time at which the item was added.

void
setViewCount(integer $viewCount)

Sets the number of times the item has been viewed.

integer
getViewCount()

Returns the number of times the item has been viewed.

getMedia()

Returns the media info of the item.

void
setMedia(array $media)

Sets the media info of the item.

void
setGenres(array $genres)

Sets the genres info of the item.

getDirector()

Returns the director info of the item.

void
setDirector(array $director)

Sets the director info of the item.

getWriter()

Returns the writer info of the item.

void
setWriter(array $writer)

Sets the writer info of the item.

getProducer()

Returns the producer info of the item.

void
setProducer(array $producer)

Sets the producer info of the item.

getCountry()

Returns the country info of the item.

void
setCountry(array $country)

Sets the country info of the item.

getRoles()

Returns the roles info of the item.

void
setRoles(array $roles)

Sets the roles info of the item.

Details

in Plex_MachineAbstract at line 78
protected string getBaseUrl()

Returns the base URL, which will be standard for all requests made to the Plex machine.

Return Value

string The base URL, which will be standard for all requests made to the Plex machine.

in Plex_MachineAbstract at line 102
protected array xmlAttributesToArray(SimpleXMLElement $xml, integer $pass = 0)

Typically the useful data returned by a Plex machine will containted in XML attributes. This allows a set of XML nodes to be passed and all the attribues extracted and returned as an associated array.

Parameters

SimpleXMLElement $xml An XML node to have its attributes converted to a useful PHP array.
integer $pass The number of recursive levels down the method has run. This is mainly used for determining if we are on our first pass or not because the data is picked up slightly differently on the first pass.

Return Value

array An associated array of XML attributes.

in Plex_MachineAbstract at line 149
protected array makeCall(string $url)

Utilizes php-curl to send a request to the passed URL and returns an XML document reprentation of the returned content.

Parameters

string $url The URL to which the request is to be made.

Return Value

array An XML document from a Plex machine converted in array.

Exceptions

Plex_Exception_Machine

in Plex_MachineAbstract at line 196
protected string getCallingFunction(integer $depth = 2)

Universal function so any method belonging to a child class of a Plex machine can discover which function called it. This is used mainly for some of our polymorphic requests as the calling function can tell us what type of item is being requested.

Parameters

integer $depth Depth defaults to 2 because 0 is this function and 1 will be the function that asked for the calling function. This can be changed by the calling function in case a specific calling function needs to be identified. This can be handy if the original calling function goes through a number of hops on its way to identification.

Return Value

string The name of the function that called the function that issued the getCallingFunction request.

in Plex_Server at line 75
void __construct(string $name, string $address, integer $port, string $token)

Sets up our Plex server using the minimum amount of data required to interact.

Parameters

string $name The name of the Plex server.
string $address The IP address of the Plex server.
integer $port The port on which the Plex server is listening.
string $token The token of the Plex server.

Return Value

void

in Plex_Server at line 99
Plex_Client[] getClients()

Returns all the available clients to which the Plex server has access indexed by the Plex client name.

Return Value

Plex_Client[] An array of Plex clients indexed by the Plex client name.

in Plex_Server at line 138
Plex_Server_Library getLibrary()

Returns the Plex library belonging to the instantiated Plex server.

Return Value

Plex_Server_Library The Plex library belonging to the instantiated Plex server.

in Plex_Server at line 155
string getName()

Returns the Plex server's name.

Return Value

string The name of the Plex machine.

in Plex_Server at line 167
string getAddress()

Returns the Plex server's IP address.

Return Value

string The IP address of the Plex machine.

in Plex_Server at line 179
integer getPort()

Returns the port on which the Plex server listens.

Return Value

integer The port on which the Plex machine listens.

in Plex_Server at line 191
string getToken()

Returns the token on which the Plex machine listens.

Return Value

string The token on which the Plex machine listens.

in Plex_Server_Library at line 123
protected string buildUrl(string $endpoint)

Generic way of building a url agains the Plex library.

Parameters

string $endpoint A URL endpoint of a Plex service.

Return Value

string A Plex library URL based on the given endpoint.

in Plex_Server_Library at line 160
protected mixed[] getItems(string $endpoint)

Generic way of requesting Plex library items.

Parameters

string $endpoint A URL endpoint of a Plex service.

Return Value

mixed[] An array of plex library items.

in Plex_Server_Library at line 204
string functionToType($function)

Given a function name, uses that name to decide what Plex library item item type with which the function is associated. This is useful when trying to polymorphically request items because we can use the calling function to abstractly identify what type of item with which we are dealing.

Parameters

$function

Return Value

string The type of item with which the given function is associated.

in Plex_Server_Library at line 240
mixed[] getSections()

Returns an array of user defined Plex library sections that can be used to interact with the items contained within.

Return Value

mixed[] An array of user defined Plex library sections.

in Plex_Server_Library at line 280
mixed getSectionByKey(integer $key) deprecated

deprecated This method is deprecated in lieu of the new getSection() method.

Returns a Plex library section by its given key. Here we simply run self::getSections() because the endpoint /library/sections/ID does not return full section data, it returns the categories below the section.

Parameters

integer $key The key of the requested section.

Return Value

mixed The request library section.

Exceptions

Plex_Exception_Server_Library

in Plex_Server_Library at line 311
mixed getSection(integer|string $polymorphicData)

Returns a Plex library section by its given key or by a exact match on title. Here we simply run self::getSections() because the endpoint /library/sections/ID does not return full section data, it returns the categories below the section.

Parameters

integer|string $polymorphicData The key or title of the requested section.

Return Value

mixed The request library section.

Exceptions

Plex_Exception_Server_Library()

in Plex_Server_Library at line 343
mixed[] getRecentlyAddedItems()

Returns the recently added items at the library level.

Return Value

mixed[] An array of plex library items.

in Plex_Server_Library at line 356
mixed[] getOnDeckItems()

Returns the on deck items at the library level.

Return Value

mixed[] An array of plex library items.

at line 205
void setAttributes(array $attribute)

Sets an array of attributes, if they exist, to the corresponding class member.

Parameters

array $attribute Array of attributes to be added to the object.

Return Value

void

protected string buildEndpoint(string $endpoint)

Generic method for building a Plex library section endpoint.

Parameters

string $endpoint The specific section endpoint to be added to the generic Plex library section endpoint.

Return Value

string The requested endpoint.

protected string buildSearchEndpoint(integer $type, string $query)

Builds an endpoint to search a Plex library section.

Parameters

integer $type The type of item to be searched.
string $query The string of text against which the search will be run.

Return Value

string The requested search endpoint.

protected Plex_Server_Library_ItemAbstract[] getAllItems()

Generic method allowing a child class to retrieve all items for its section.

Return Value

Plex_Server_Library_ItemAbstract[] An array of Plex library items.

protected getUnwatchedItems()

Generic method allowing a child class to retrieve all unwatched items for its section.

protected getNewestItems()

Generic method allowing a child class to retrieve the newest items for its section.

protected Plex_Server_Library_ItemAbstract[] getRecentlyAddedSectionItems()

Generic method allowing a child class to retrieve recently added items for its section. It is named slightly differently as it collided with the library method of the same name.

Return Value

Plex_Server_Library_ItemAbstract[] An array of Plex library items.

protected Plex_Server_Library_ItemAbstract[] getOnDeckSectionItems()

Generic method allowing a child class to retrieve the on deck items for its section. It is named slightly differently as it collided with the library method of the same name.

Return Value

Plex_Server_Library_ItemAbstract[] An array of Plex library items.

protected Plex_Server_Library_ItemAbstract[] getRecentlyViewedItems()

Generic method allowing a child class to retrieve recently viewed items for its section.

Return Value

Plex_Server_Library_ItemAbstract[] An array of Plex library items.

protected Plex_Server_Library_ItemAbstract[] getItemsByCollection(integer $collectionKey)

Generic method allowing a child class to retrieve recently viewed items for its section.

Parameters

integer $collectionKey Key that represents the collection by which the items will be retrieved. The collection key can be discovered by using the getCollections() method in this same class.

Return Value

Plex_Server_Library_ItemAbstract[] An array of Plex library items.

protected Plex_Server_Library_ItemAbstract[] getItemsByFirstCharacter(string $character)

Generic method allowing a child class to retrieve items by first character from its section.

Parameters

string $character The first character by which the items will be retrieved.

Return Value

Plex_Server_Library_ItemAbstract[] An array of Plex library items.

protected Plex_Server_Library_ItemAbstract[] getItemsByGenre(integer $genreKey)

Generic method allowing a child class to retrieve items by genre from its section.

Parameters

integer $genreKey Key that represents the genre by which the items will be retrieved. The genre key can be discovered by using the getGenres() method in this same class.

Return Value

Plex_Server_Library_ItemAbstract[] An array of Plex library items.

protected Plex_Server_Library_ItemAbstract[] getItemsByYear(integer $year)

Generic method allowing a child class to retrieve items by four digit year from its section

Parameters

integer $year Four digit year by which the items will be retrieved.

Return Value

Plex_Server_Library_ItemAbstract[] An array of Plex library items.

at line 327
Plex_Server_Library_ItemAbstract getPolymorphicItem(integer|string $polymorphicData, boolean $scopedToItem = FALSE)

Override of the section version of this method so we can apply slightly different rules when retrieving single children and grandchildren at the item level.

Parameters

integer|string $polymorphicData Either a rating key, a key, or a title for an exact title match that will be used to retrieve a single library item.
boolean $scopedToItem Tells the method whether or not we are scoped to an item. If we are scoped to an item then we are use get methods instead of search methods.

Return Value

Plex_Server_Library_ItemAbstract The request Plex library item.

array getFirstCharacters()

Returns a list with first letter of title, key and size for the child class's section. We use makeCall directly here, because we want to return just the raw array of caracters and not do any post processing on it.

Return Value

array An array with data of the first character of the items.

array getAlphabet()

Returns a list of alphanumeric of first letter for the child class's section.

Return Value

array An array of first letter of the items.

array getCollections()

Returns a list of collections for the child class's section. We use makeCall directly here, because we want to return just the raw array of collections and not do any post processing on it.

Return Value

array An array of collections with their names and keys.

at line 798
array getGenres()

Returns the genres info of the item.

Return Value

array An array of genres with their names and keys.

at line 396
static Plex_Server_Library_SectionAbstract factory(string $type, string $name, string $address, integer $port, string $token)

Static factory method used to instantiate child item classes by their type.

Parameters

string $type The type of child section class being instantiated.
string $name The name of the Plex server.
string $address The IP address of the Plex server.
integer $port The port on which the Plex server is listening.
string $token The $token of the Plex server.

Return Value

Plex_Server_Library_SectionAbstract An instantiated section child class.

string getArt()

Returns a reference to the section's art.

Return Value

string A reference to the section's art.

void setArt(string $art)

Sets a reference to the section's art.

Parameters

string $art A reference to the section's art.

Return Value

void

boolean isRefreshing()

Tells whether the section is currently in the process of refreshing.

Return Value

boolean Whether or not the section is refreshing.

void setRefreshing(boolean $refreshing)

Sets whether the section is currently in the process of refreshing.

Parameters

boolean $refreshing Whether or not the section is refreshing.

Return Value

void

at line 505
integer getKey()

Returns the key of the item.

Return Value

integer The section's key.

at line 519
void setKey(integer $key)

Sets the key of the item.

Parameters

integer $key The section's key.

Return Value

void

at line 531
string getType()

Returns the type of the item.

Return Value

string The section's type.

at line 545
void setType(string $type)

Sets the type of the item.

Parameters

string $type The section's type.

Return Value

void

at line 557
string getTitle()

Returns the title of the item.

Return Value

string The section's title.

at line 571
void setTitle(string $title)

Sets the title of the item.

Parameters

string $title The section's title.

Return Value

void

string getAgent()

Returns the section's agent.

Return Value

string The section's agent.

void setAgent(string $agent)

Sets the section's agent.

Parameters

string $agent The section's agent.

Return Value

void

string getScanner()

Returns the section's scanner

Return Value

string The section's scanner.

void setScanner(string $scanner)

Sets the section's scanner

Parameters

string $scanner The section's scanner.

Return Value

void

string getLanguage()

Returns the section's language.

Return Value

string The section's language.

void setLanguage(string $language)

Sets the section's language.

Parameters

string $language The section's language.

Return Value

void

string getUuid()

Returns the section's universally unique identifier.

Return Value

string The section's universally unique identifier.

void setUuid(string $uuid)

Sets the section's universally unique identifier.

Parameters

string $uuid The section's universally unique identifier.

Return Value

void

at line 715
DateTime getUpdatedAt()

Returns the time at which the item was last updated.

Return Value

DateTime The time at which the section was last updated.

at line 756
void setUpdatedAt(integer $updatedAtTs)

Sets the time at which the item was last updated.

Parameters

integer $updatedAtTs The unix timestamp representing the time the section was last updated. This will be turned into a DateTime object.

Return Value

void

DateTime getCreatedAt()

Returns the time at which the section was created.

Return Value

DateTime The time at which the section was created.

void setCreatedAt(integer $createdAtTs)

Sets the time at which the section was last created.

Parameters

integer $createdAtTs The unix timestamp representing the time the section was created. This will be turned into a DateTime object.

Return Value

void

at line 283
Plex_Server_Library_ItemAbstract getItemByIndex(integer $index)

Returns a single item by its index.

Parameters

integer $index The index by which the item will be matched and returned.

Return Value

Plex_Server_Library_ItemAbstract A single Plex library item.

at line 354
protected string buildChildrenEndpoint()

Builds an endpoint for an item to retrieve its children and grandchildren items.

Return Value

string The requested children endpoint.

at line 373
protected string buildAllLeavesEndpoint()

Builds an endpoint for an item to retrieve all of its grandchildren.

Return Value

string The requested grandchildren endpoint.

at line 415
string buildUrlThumb()

Build a url with access to the thumbnail image.

Return Value

string An url with access the thumbnail image.

at line 427
boolean doesAllowSync()

Says whether or not the item is available for sync.

Return Value

boolean Whether or not the item is available for sync.

at line 441
void setAllowSync(boolean $allowSync)

Sets whether or not the item is available for sync.

Parameters

boolean $allowSync Whether or not the item is available for sync.

Return Value

void

at line 453
int getLibrarySectionId()

Return library section ID to which the item belongs.

Return Value

int The library ID to which the item belongs.

at line 467
void setLibrarySectionId(int $librarySectionId)

Sets the library section ID to which the item belongs.

Parameters

int $librarySectionId The library ID to which the item belongs.

Return Value

void

at line 479
int getRatingKey()

Returns the rating key of the item.

Return Value

int The rating key of the item.

at line 493
void setRatingKey(int $ratingKey)

Sets the rating key of the item.

Parameters

int $ratingKey The rating key of the item.

Return Value

void

at line 583
string getTitleSort()

Returns the sort title of the item.

Return Value

string The sort title of the item.

at line 597
void setTitleSort(string $titleSort)

Sets the sort title of the item.

Parameters

string $titleSort The sort title of the item.

Return Value

void

at line 609
string getSummary()

Returns the summary of the item.

Return Value

string The summary of the item.

at line 623
void setSummary(string $summary)

Sets the summary of the item.

Parameters

string $summary The summary of the item.

Return Value

void

at line 635
int getIndex()

Returns the index of the item.

Return Value

int The index of the item.

at line 649
void setIndex(int $index)

Sets the index of the item.

Parameters

int $index The index of the item.

Return Value

void

at line 661
string getThumb()

Returns the thumb reference of the item.

Return Value

string The thumb reference of the item.

at line 675
void setThumb(string $thumb)

Sets the thumb reference of the item.

Parameters

string $thumb The thumb reference of the item.

Return Value

void

at line 687
DateTime getAddedAt()

Returns the time at which the item was added.

Return Value

DateTime The time at which the item was added.

at line 702
void setAddedAt(integer $addedAtTs)

Sets the time at which the item was added.

Parameters

integer $addedAtTs The unix timestamp representing the time the item was last added. This will be turned into a DateTime object.

Return Value

void

at line 729
void setViewCount(integer $viewCount)

Sets the number of times the item has been viewed.

Parameters

integer $viewCount The number of times the item has been viewed.

Return Value

void

at line 741
integer getViewCount()

Returns the number of times the item has been viewed.

Return Value

integer The number of times the item has been viewed.

at line 769
Plex_Server_Library_Item_Media getMedia()

Returns the media info of the item.

Return Value

Plex_Server_Library_Item_Media THe media info of the item.

at line 785
void setMedia(array $media)

Sets the media info of the item.

Parameters

array $media Raw media info that is to be converted into a media info object.

Return Value

void

at line 814
void setGenres(array $genres)

Sets the genres info of the item.

Parameters

array $genres Raw genres info that is to be converted into a genres info object.

Return Value

void

at line 831
Plex_Server_Library_Item_Tag getDirector()

Returns the director info of the item.

Return Value

Plex_Server_Library_Item_Tag The director info of the item.

at line 847
void setDirector(array $director)

Sets the director info of the item.

Parameters

array $director Raw director info that is to be converted into a director info object.

Return Value

void

at line 860
Plex_Server_Library_Item_Tag getWriter()

Returns the writer info of the item.

Return Value

Plex_Server_Library_Item_Tag The writer info of the item.

at line 876
void setWriter(array $writer)

Sets the writer info of the item.

Parameters

array $writer Raw writer info that is to be converted into a writer info object.

Return Value

void

at line 889
Plex_Server_Library_Item_Tag getProducer()

Returns the producer info of the item.

Return Value

Plex_Server_Library_Item_Tag The producer info of the item.

at line 905
void setProducer(array $producer)

Sets the producer info of the item.

Parameters

array $producer Raw producer info that is to be converted into a producer info object.

Return Value

void

at line 918
Plex_Server_Library_Item_Tag getCountry()

Returns the country info of the item.

Return Value

Plex_Server_Library_Item_Tag The country info of the item.

at line 934
void setCountry(array $country)

Sets the country info of the item.

Parameters

array $country Raw country info that is to be converted into a country info object.

Return Value

void

at line 947
Plex_Server_Library_Item_Tag[] getRoles()

Returns the roles info of the item.

Return Value

Plex_Server_Library_Item_Tag[] The roles info of the item.

at line 963
void setRoles(array $roles)

Sets the roles info of the item.

Parameters

array $roles Raw roles info that is to be converted into a roles info object.

Return Value

void