public function device($idenOrNickname)
    {
        if ($this->devices === null) {
            $this->getDevices();
        }

        foreach ($this->devices as $d) {
            if ($d->iden == $idenOrNickname || $d->nickname == $idenOrNickname) {
                return $d;
            }
        }

        throw new Exceptions\NotFoundException("Device not found.");
    }
public function device($idenOrNickname)
    {
        if ($this->devices === null) {
            $this->getDevices();
        }

        foreach ($this->devices as $d) {
            if ($d->iden == $idenOrNickname || $d->nickname == $idenOrNickname) {
                return $d;
            }
        }

        throw new Exceptions\NotFoundException("Device not found.");
    }
public function device ( $ idenOrNickname ) { if ( $ this -> devices === null ) { $ this -> getDevices ( ) ; } foreach ( $ this -> devices as $ d ) { if ( $ d -> iden == $ idenOrNickname || $ d -> nickname == $ idenOrNickname ) { return $ d ; } } throw new Exceptions \ NotFoundException ( "Device not found." ) ; }
Target a device by its iden or nickname.

@param string $idenOrNickname device_iden or nickname of the device.

@return Device The device.
@throws Exceptions\ConnectionException
@throws Exceptions\InvalidTokenException
@throws Exceptions\NotFoundException
Target a device by its iden or nickname .