Device

Extends \NextEvent\PHPSDK\Model\Model

Device model

A device entity represents a real world device. It holds information such as the device UUID, platform(os) and it's version and the device name. A device can also tell on which gate it is logged in and when it has been logged in the last time.

package

NextEvent\PHPSDK\Model

Methods

Supports getX or hasX Methods for properties which are yet unknown.

__call(string $name, array $args) : mixed
inherited

If the source of your model contains, e.g. a property named 'my_property', you can call getMyProperty() to retrieve it's value.

Arguments

$name

string

$args

array

Response

mixed

Model constructor

__construct(array $source) 
inherited

Parse source data.

Throws
\NextEvent\PHPSDK\Exception\InvalidModelDataException

Arguments

$source

array

The source data as received from the API

Get the value for the given variable.

get(string $var) : mixed
inherited

Should be used, if you expect the model to have custom properties which are not known/covered by the known getters

Arguments

$var

string

Response

mixed

Get the changed date of this device

getChangedDate() : \NextEvent\PHPSDK\Model\DateTime|null

Get the creation data of this device

getCreatedDate() : \NextEvent\PHPSDK\Model\DateTime|null

Get the gate of this device

getGate() : \NextEvent\PHPSDK\Model\Gate

Get the gate id for this device, which tells whether the device is logged in or not

getGateId() : integer|null

Response

integer|null

Get the internal unique identifier for this device

getId() : integer

Response

integer

Get the last login date for this device

getLastLogin() : \NextEvent\PHPSDK\Model\DateTime|null

Get the name for this device

getName() : string

Response

string

Get the platform for this device, e.g. Android or iOS

getPlatform() : string|null

Response

string|null

Get the universal unique identifier for this device

getUUID() : string

Response

string

Get the os version for this device

getVersion() : string|null

Response

string|null

Check model state if it is valid

isValid() : boolean
inherited abstract

Response

boolean

Logs this device out from the gate it is logged in at.

logout() : \NextEvent\PHPSDK\Model\Device
Throws
\NextEvent\PHPSDK\Exception\DeviceLogoutException

If no rest client has been set on this model.

Response

\NextEvent\PHPSDK\Model\Device

String representation of object

serialize() : string
inherited

Implements Serializable interface

Response

string

Convert model to an Array

toArray() : array
inherited

Response

array

Convert the model for logging

toLogContext() : array
inherited

Implements the LogContextInterface interface

Response

array

Represent the model as string

toString() : string
inherited

Response

string

Constructs the object from a string

unserialize( $serialized) 
inherited

Implements Serializable interface

Arguments

$serialized