PHP Class duncan3dc\Sonos\Tracks\Factory

Datei anzeigen Open project: duncan3dc/sonos Class Usage Examples

Protected Properties

Property Type Description
$controller duncan3dc\Sonos\Controller A Controller instance to communicate with.

Public Methods

Method Description
__construct ( Controller $controller ) Create an instance of the Factory class.
createFromUri ( string $uri ) : duncan3dc\Sonos\Tracks\Track Create a new Track instance from a URI.
createFromXml ( duncan3dc\DomParser\XmlElement $xml ) : duncan3dc\Sonos\Tracks\Track Create a new Track instance from a URI.

Protected Methods

Method Description
guessTrackClass ( string $uri ) : string Get the name of the Track class that represents a URI.

Method Details

__construct() public method

Create an instance of the Factory class.
public __construct ( Controller $controller )
$controller duncan3dc\Sonos\Controller A Controller instance to communicate with

createFromUri() public method

Create a new Track instance from a URI.
public createFromUri ( string $uri ) : duncan3dc\Sonos\Tracks\Track
$uri string The URI of the track
return duncan3dc\Sonos\Tracks\Track

createFromXml() public method

Create a new Track instance from a URI.
public createFromXml ( duncan3dc\DomParser\XmlElement $xml ) : duncan3dc\Sonos\Tracks\Track
$xml duncan3dc\DomParser\XmlElement The xml element representing the track meta data.
return duncan3dc\Sonos\Tracks\Track

guessTrackClass() protected method

Get the name of the Track class that represents a URI.
protected guessTrackClass ( string $uri ) : string
$uri string The URI of the track
return string

Property Details

$controller protected_oe property

A Controller instance to communicate with.
protected Controller,duncan3dc\Sonos $controller
return duncan3dc\Sonos\Controller