PHP Class DeviceDetector\Parser\Device\DeviceParserAbstract

Abstract class for all device parsers
Inheritance: extends DeviceDetector\Parser\ParserAbstract
Mostrar archivo Open project: piwik/device-detector Class Usage Examples

Public Properties

Property Type Description
$deviceBrands array Note: Before using a new brand in on of the regex files, it needs to be added here

Protected Properties

Property Type Description
$brand
$deviceType
$deviceTypes array Detectable device types
$model

Public Methods

Method Description
getAvailableDeviceTypeNames ( ) : array Returns names of all available device types
getAvailableDeviceTypes ( ) : array Returns available device types
getBrand ( ) : string Returns the detected device brand
getDeviceName ( integer $deviceType ) : mixed Returns the name of the given device type
getDeviceType ( )
getFullName ( string $brandId ) : string Returns the full brand name for the given short name
getModel ( ) : string Returns the detected device model
parse ( )
setUserAgent ( string $userAgent ) Sets the useragent to be parsed

Protected Methods

Method Description
buildModel ( $model, $matches )
reset ( )

Method Details

buildModel() protected method

protected buildModel ( $model, $matches )

getAvailableDeviceTypeNames() public static method

Returns names of all available device types
public static getAvailableDeviceTypeNames ( ) : array
return array

getAvailableDeviceTypes() public static method

Returns available device types
public static getAvailableDeviceTypes ( ) : array
return array

getBrand() public method

Returns the detected device brand
public getBrand ( ) : string
return string

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

getDeviceType() public method

public getDeviceType ( )

getFullName() public static method

Returns the full brand name for the given short name
public static getFullName ( string $brandId ) : string
$brandId string short brand name
return string

getModel() public method

Returns the detected device model
public getModel ( ) : string
return string

parse() public method

public parse ( )

reset() protected method

protected reset ( )

setUserAgent() public method

Sets the useragent to be parsed
public setUserAgent ( string $userAgent )
$userAgent string

Property Details

$brand protected_oe property

protected $brand

$deviceBrands public_oe static_oe property

Note: Before using a new brand in on of the regex files, it needs to be added here
public static array $deviceBrands
return array

$deviceType protected_oe property

protected $deviceType

$deviceTypes protected_oe static_oe property

Detectable device types
protected static array $deviceTypes
return array

$model protected_oe property

protected $model