Class Device

Class Device A representation of a device

Concrete\Core\Device\Device implements Concrete\Core\Device\DeviceInterface
Namespace: Concrete\Core\Device
Package: Concrete\Core\Device
Located at src/Device/Device.php

Methods summary

public
# __construct( string $handle, string $name, string $brand, string $user_agent, integer $width, integer $height, integer $type, integer $ratio = 1 )
public string
# getHandle( )

Get the device handle

public string
# getName( )

Get the device name

public string
# getBrand( )

Get the device brand

public string
# getUserAgent( )

Get the device user agent

public integer
# getWidth( )

Get the screen width of the device in pixels Be sure to adjust this by the device pixel ratio

public integer
# getHeight( )

Get the screen height of the device in pixels Be sure to adjust this by the device pixel ratio

public integer
# getType( )

Get the devices type this is an int that maps to a constant on this class, UNKNOWN MOBILE TABLET or DESKTOP If testing against a device and not against "UNKNOWN", do not test this directly against a device type, instead use bitwise AND to test for the enum you'd like to test:

public integer
# getPixelRatio( )

Get the device pixel ratio

public string
# getViewportHTML( )

Get the HTML for this device's viewport

public string
# getIconClass( )

Get the class to be used for this device's icon

public boolean
# isMobile( )
public boolean
# isTablet( )
public boolean
# isDesktop( )
public string
# getDefaultOrientation( )

Get the device's default orientation

public static static
# configConstructor( $handle, array $config )

Construct from given configuration

Constants summary

Properties summary

protected string $handle
#
protected string $name
#
protected string $brand
#
protected string $orientation
#
protected string $agent
#
protected integer $width
#
protected integer $height
#
protected integer $ratio

The device pixel ratio

#
protected integer $type

Device::UNKNOWN|Device::MOBILE|Device::TABLET|Device::DESKTOP

#