public initActiveDevice ( string $deviceName, DataSift\Storyplayer\Injectables $injectables ) : void | ||
$deviceName | string | the name of the device to make active |
$injectables | DataSift\Storyplayer\Injectables | our DI container, which contains the list of known devices |
Результат | void |
public function initActiveDevice($deviceName, $injectables)
{
// does the device exist?
if (!$injectables->knownDevicesList->hasEntry($deviceName)) {
throw new E4xx_NoSuchDevice($deviceName);
}
// yes it does
$this->activeDevice = $injectables->knownDevicesList->getEntry($deviceName)->getConfig();
// remember the device name
$this->activeDeviceName = $deviceName;
}