\duncan3dc\Sonos\TracksFactory

Factory for creating Track instances.

Summary

Methods
Properties
Constants
__construct()
createFromUri()
createFromXml()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
guessTrackClass()
$controller
N/A

Properties

Methods

__construct()

__construct(\duncan3dc\Sonos\Interfaces\ControllerInterface  $controller) 

Create an instance of the Factory class.

Parameters

\duncan3dc\Sonos\Interfaces\ControllerInterface $controller

A Controller instance to communicate with

createFromUri()

createFromUri(string  $uri) : \duncan3dc\Sonos\Interfaces\TrackInterface

Create a new Track instance from a URI.

Parameters

string $uri

The URI of the track

Returns

\duncan3dc\Sonos\Interfaces\TrackInterface

createFromXml()

createFromXml(\duncan3dc\DomParser\XmlElement  $xml) : \duncan3dc\Sonos\Interfaces\TrackInterface

Create a new Track instance from a URI.

Parameters

\duncan3dc\DomParser\XmlElement $xml

The xml element representing the track meta data.

Returns

\duncan3dc\Sonos\Interfaces\TrackInterface

guessTrackClass()

guessTrackClass(string  $uri) : string

Get the name of the Track class that represents a URI.

Parameters

string $uri

The URI of the track

Returns

string