DeviceDetector\Parser\Device\DeviceParserAbstract::getDeviceName PHP Method

getDeviceName() public static method

Returns the name of the given device type
public static getDeviceName ( integer $deviceType ) : mixed
$deviceType integer one of the DEVICE_TYPE_* constants
return mixed
    public static function getDeviceName($deviceType)
    {
        return array_search($deviceType, self::$deviceTypes);
    }

Usage Example

コード例 #1
0
 /**
  * Returns the device type extracted from the parsed UA
  *
  * @see DeviceParserAbstract::$deviceTypes for available device types
  *
  * @return string
  */
 public function getDeviceName()
 {
     if ($this->getDevice() !== null) {
         return DeviceParserAbstract::getDeviceName($this->getDevice());
     }
     return '';
 }