Documentation

CachedCollection
in package
implements CollectionInterface

FinalYes

Cache the collection of devices.

Table of Contents

Interfaces

CollectionInterface
Manage a group of devices.

Constants

CACHE_KEY  : mixed = "device-ip-addresses"

Properties

$cache  : CacheInterface
$collection  : CollectionInterface
$retrieved  : bool

Methods

__construct()  : mixed
Create a new instance.
addDevice()  : $this
Add a device to this collection.
addIp()  : $this
Add a device to this collection using its IP address
clear()  : $this
Remove all devices from this collection.
getDevices()  : array<string|int, DeviceInterface>
Get all of the devices on the current network
getLogger()  : LoggerInterface
Get the logger currently in use.
setLogger()  : void
clearCache()  : void
Remove any cached data we have.

Constants

Properties

$cache

private CacheInterface $cache

The cache object to use for finding Sonos devices on the network.

$retrieved

private bool $retrieved = false

A flag to indicate whether we've retrieved the devices from cache yet or not.

Methods

addIp()

Add a device to this collection using its IP address

public addIp(string $address) : $this
Parameters
$address : string

The IP address of the device to add

Return values
$this

clear()

Remove all devices from this collection.

public clear() : $this
Return values
$this

getLogger()

Get the logger currently in use.

public getLogger() : LoggerInterface
Return values
LoggerInterface

setLogger()

public setLogger(LoggerInterface $logger) : void
Parameters
$logger : LoggerInterface

clearCache()

Remove any cached data we have.

private clearCache() : void
On this page

Search results