PHP Class WhichBrowser\Model\Device

Inheritance: extends WhichBrowser\Model\Primitive\Base
Show file Open project: whichbrowser/parser Class Usage Examples

Public Properties

Property Type Description
$carrier string
$flag mixed
$generic boolean
$hidden boolean
$identified integer
$identifier integer
$manufacturer string
$model string
$series string
$subtype string
$type string

Public Methods

Method Description
getCarrier ( ) : string Get the name of the carrier in a human readable format
getManufacturer ( ) : string Get the name of the manufacturer in a human readable format
getModel ( ) : string Get the name of the model in a human readable format
identifyModel ( string $pattern, string $subject, array | null $defaults = [] ) : string Identify the manufacturer and model based on a pattern
isDetected ( ) : boolean Check if device information is detected
reset ( array | null $properties = null ) Set the properties to the default values
setIdentification ( array $properties ) : string Declare an positive identification
toArray ( ) : array Get an array of all defined properties
toString ( ) : string Get the combined name of the manufacturer and model in a human readable format

Method Details

getCarrier() public method

Get the name of the carrier in a human readable format
public getCarrier ( ) : string
return string

getManufacturer() public method

Get the name of the manufacturer in a human readable format
public getManufacturer ( ) : string
return string

getModel() public method

Get the name of the model in a human readable format
public getModel ( ) : string
return string

identifyModel() public method

Identify the manufacturer and model based on a pattern
public identifyModel ( string $pattern, string $subject, array | null $defaults = [] ) : string
$pattern string The regular expression that defines the group that matches the model
$subject string The string the regular expression is matched with
$defaults array | null An optional array of properties to set together
return string

isDetected() public method

Check if device information is detected
public isDetected ( ) : boolean
return boolean

reset() public method

Set the properties to the default values
public reset ( array | null $properties = null )
$properties array | null An optional array of properties to set after setting it to the default values

setIdentification() public method

Declare an positive identification
public setIdentification ( array $properties ) : string
$properties array An array, the key of an element determines the name of the property
return string

toArray() public method

Get an array of all defined properties
public toArray ( ) : array
return array

toString() public method

Get the combined name of the manufacturer and model in a human readable format
public toString ( ) : string
return string

Property Details

$carrier public property

public string $carrier
return string

$flag public property

public mixed $flag
return mixed

$generic public property

public bool $generic
return boolean

$hidden public property

public bool $hidden
return boolean

$identified public property

public int $identified
return integer

$identifier public property

public int $identifier
return integer

$manufacturer public property

public string $manufacturer
return string

$model public property

public string $model
return string

$series public property

public string $series
return string

$subtype public property

public string $subtype
return string

$type public property

public string $type
return string