PHP Class izzum\examples\trafficlight\rules\CanSwitch

It only has knowledge about a traffic light domain model and no knowledge about any statemachine. The TrafficLight instance will be injected at runtime via the statemachine that makes use of the EntityBuilderTrafficLight. A rule should never have side effects. instead, it should only check if some condition is true or false.
Inheritance: extends izzum\rules\Rule
Show file Open project: rolfvreijdenberger/izzum-statemachine

Public Methods

Method Description
__construct ( TrafficLight $light ) constructor. get the domain object injected

Protected Methods

Method Description
_applies ( ) overriden method with the correct implementation for our domain logic {@inheritDoc}

Method Details

__construct() public method

constructor. get the domain object injected
public __construct ( TrafficLight $light )
$light izzum\examples\trafficlight\TrafficLight

_applies() protected method

overriden method with the correct implementation for our domain logic {@inheritDoc}
protected _applies ( )