PHP Class Phue\Condition

Show file Open project: sqmk/phue

Protected Properties

Property Type Description
$attribute string Attribute to target condition
$operator Operator
$sensorId string Sensor Id
$value string Value to match

Public Methods

Method Description
__construct ( stdClass $condition = null ) Construct a condition object
changed ( ) : self Set operator to changed
equals ( ) : self Set operator to equals
export ( ) : stdClass Export for API request
getAttribute ( ) : string Get attribute
getOperator ( ) : string Get operator
getSensorId ( ) : string Get sensor Id
getValue ( ) : string Get value
greaterThan ( ) : self Set operator to greater than
import ( stdClass $condition ) : self Import from API response
lessThan ( ) : self Set operator to less than
setAttribute ( string $attribute ) : self Set attribute to target condition
setOperator ( string $operator ) : self Set operator
setSensorId ( mixed $sensorId ) : self Set sensor Id
setValue ( string $value ) : self Set value to match

Method Details

__construct() public method

Construct a condition object
public __construct ( stdClass $condition = null )
$condition stdClass Condition attributes

changed() public method

Set operator to changed
public changed ( ) : self
return self This object

equals() public method

Set operator to equals
public equals ( ) : self
return self This object

export() public method

Export for API request
public export ( ) : stdClass
return stdClass Result object

getAttribute() public method

Get attribute
public getAttribute ( ) : string
return string Attribute

getOperator() public method

Get operator
public getOperator ( ) : string
return string Operator

getSensorId() public method

Get sensor Id
public getSensorId ( ) : string
return string Sensor Id

getValue() public method

Get value
public getValue ( ) : string
return string Value

greaterThan() public method

Set operator to greater than
public greaterThan ( ) : self
return self This object

import() public method

Import from API response
public import ( stdClass $condition ) : self
$condition stdClass Condition values
return self This object

lessThan() public method

Set operator to less than
public lessThan ( ) : self
return self This object

setAttribute() public method

Set attribute to target condition
public setAttribute ( string $attribute ) : self
$attribute string Attribute
return self This object

setOperator() public method

Set operator
public setOperator ( string $operator ) : self
$operator string Operator
return self This object

setSensorId() public method

Set sensor Id
public setSensorId ( mixed $sensorId ) : self
$sensorId mixed Sensor Id or Sensor object
return self This object

setValue() public method

Set value to match
public setValue ( string $value ) : self
$value string Value
return self This object

Property Details

$attribute protected property

Attribute to target condition
protected string $attribute
return string

$operator protected property

Operator
protected $operator

$sensorId protected property

Sensor Id
protected string $sensorId
return string

$value protected property

Value to match
protected string $value
return string