PHP Class izzum\examples\trafficlight\TrafficLight

It has a unique identifier, the color it is currently on and the time since the last switch. - the Rule will query it for information (isReadyToSwitch) - the Commands will manipulate the object to set it's color
Show file Open project: rolfvreijdenberger/izzum-statemachine Class Usage Examples

Public Methods

Method Description
__construct ( $id )
isReadyToSwitch ( )
setGreen ( )
setOrange ( )
setRed ( )
toString ( )

Protected Methods

Method Description
onColorFor ( $time )
setColor ( $color )
setId ( $id )
setSwitchTime ( )

Method Details

__construct() public method

public __construct ( $id )

isReadyToSwitch() public method

public isReadyToSwitch ( )

onColorFor() protected method

protected onColorFor ( $time )

setColor() protected method

protected setColor ( $color )

setGreen() public method

public setGreen ( )

setId() protected method

protected setId ( $id )

setOrange() public method

public setOrange ( )

setRed() public method

public setRed ( )

setSwitchTime() protected method

protected setSwitchTime ( )

toString() public method

public toString ( )