Collection
in package
implements
CollectionInterface
FinalYes
Table of Contents
Interfaces
- CollectionInterface
- Manage a group of devices.
Properties
- $devices : array<string|int, DeviceInterface>
- $factory : FactoryInterface
- $logger : LoggerInterface|null
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 in this collection.
- getLogger() : LoggerInterface
- Get the logger currently in use.
- setLogger() : void
Properties
$devices
private
array<string|int, DeviceInterface>
$devices
= []
The devices that are in this collection.
$factory
private
FactoryInterface
$factory
$logger
private
LoggerInterface|null
$logger
= null
Methods
__construct()
Create a new instance.
public
__construct([FactoryInterface|null $factory = null ]) : mixed
Parameters
- $factory : FactoryInterface|null = null
-
The factory to create new devices from
addDevice()
Add a device to this collection.
public
addDevice(DeviceInterface $device) : $this
Parameters
- $device : DeviceInterface
-
The device to add
Return values
$thisaddIp()
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
$thisclear()
Remove all devices from this collection.
public
clear() : $this
Return values
$thisgetDevices()
Get all of the devices in this collection.
public
getDevices() : array<string|int, DeviceInterface>
Return values
array<string|int, DeviceInterface>getLogger()
Get the logger currently in use.
public
getLogger() : LoggerInterface
Return values
LoggerInterfacesetLogger()
public
setLogger(LoggerInterface $logger) : void
Parameters
- $logger : LoggerInterface