src/CustomDevice.php
public function getCapability($capabilityName)
    {
        if (empty($capabilityName)) {
            throw new \InvalidArgumentException('capability name must not be empty');
        }

        if (!$this->getRootDevice()->isCapabilityDefined($capabilityName)) {
            throw new \InvalidArgumentException('no capability named [' . $capabilityName . '] is present in wurfl.');
        }

        foreach ($this->modelDevices as $modelDevice) {
            /* @var Device\ModelDeviceInterface $modelDevice */
            $capabilityValue = $modelDevice->getCapability($capabilityName);
            if ($capabilityValue !== null) {
                return $capabilityValue;
            }
        }

        return null;
    }
public function getCapability($capabilityName)
    {
        if (empty($capabilityName)) {
            throw new \InvalidArgumentException('capability name must not be empty');
        }

        if (!$this->getRootDevice()->isCapabilityDefined($capabilityName)) {
            throw new \InvalidArgumentException('no capability named [' . $capabilityName . '] is present in wurfl.');
        }

        foreach ($this->modelDevices as $modelDevice) {
            /* @var Device\ModelDeviceInterface $modelDevice */
            $capabilityValue = $modelDevice->getCapability($capabilityName);
            if ($capabilityValue !== null) {
                return $capabilityValue;
            }
        }

        return null;
    }
public function getCapability ( $ capabilityName ) { if ( empty ( $ capabilityName ) ) { throw new \ InvalidArgumentException ( 'capability name must not be empty' ) ; } if ( ! $ this -> getRootDevice ( ) -> isCapabilityDefined ( $ capabilityName ) ) { throw new \ InvalidArgumentException ( 'no capability named [' . $ capabilityName . '] is present in wurfl.' ) ; } foreach ( $ this -> modelDevices as $ modelDevice ) { /* @var Device\ModelDeviceInterface $modelDevice */ $ capabilityValue = $ modelDevice -> getCapability ( $ capabilityName ) ; if ( $ capabilityValue !== null ) { return $ capabilityValue ; } } return null ; }
Returns the value of a given capability name
for the current device

@param string $capabilityName must be a valid capability name

@throws \InvalidArgumentException The $capabilityName is is not defined in the loaded WURFL.

@return string|null Capability value

@see \Wurfl\Device\ModelDeviceInterface::getCapability()
Returns the value of a given capability name for the current device