PHP 클래스 izzum\statemachine\builder\ModelBuilder

This will thus not build the model when the statemachine asks for it, but rather the model is built when your application code creates it. This class is useful if your domain model actually subclasses the StateMachine class or uses object composition to use the statemachines' logic internally. In that case, you can construct the StateMachine in your models' constructor, including the Context with this class in it and with the domain model itself ($this) as an argument to the builder, so you can put our event handlers on the domain model and have them respond to the statemachine. eg: in the constructor of your domain model that uses object composition $builder = new ModelBuilder($this); $identifier = new Identifier($this->getId(), 'my-model-machine'); $context = new Context($identifier, $builder); $this->machine = new StateMachine($context); eg: in the constructor of your domain model that uses StateMachine as its' superclass $builder = new ModelBuilder($this); $identifier = new Identifier($this->getId(), 'my-model-machine'); $context = new Context($identifier, $builder); parent::__construct($context)
저자: Rolf Vreijdenberger
상속: extends izzum\statemachine\EntityBuilder
파일 보기 프로젝트 열기: rolfvreijdenberger/izzum-statemachine 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( mixed $model )

보호된 메소드들

메소드 설명
build ( Identifier $identifier ) {@inheritDoc}

메소드 상세

__construct() 공개 메소드

public __construct ( mixed $model )
$model mixed the domain model you want to have returned from this class.

build() 보호된 메소드

{@inheritDoc}
protected build ( Identifier $identifier )
$identifier izzum\statemachine\Identifier