PHP 클래스 izzum\statemachine\Identifier

A statemachine is always uniquely identified by the combination of an entity id and a machine name (that provides the relation to the statemachine the entity is governed by). the machine name should be a 'machine readable' string, since it will be stored in different backends and might be used as a key there (eg: in redis). The entity id is something that uniquely identifies a domain model. Probably something that is stored in your application, like a primary key in a table, a GUID or a hash. This object thus stores the minimum data needed from other processes in your application domain to succesfully work with the statemachine.
저자: Rolf Vreijdenberger
파일 보기 프로젝트 열기: rolfvreijdenberger/izzum-statemachine 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$entity_id string an entity id that represents the unique identifier for an application domain specific object (entity) like 'Order', 'Customer' etc.
$machine_name string this is the name of the statemachine itself and is used in conjunction with the entity_id to define what a statemachine is about.

공개 메소드들

메소드 설명
__construct ( mixed $entity_id, string $machine_name ) Constructor
__toString ( ) : string
getEntityId ( ) : string gets the entity id that represents the unique identifier for the application domain specific model.
getId ( boolean $readable = false ) : string get the unique identifier representation for an Identifier, which consists of the machine name and the entity_id in parseable form.
getMachine ( ) : string gets the statemachine name that handles the entity
setEntityId ( mixed $entity_id ) set the id of the domain specific entity (it will internally be converted to a string)
toString ( ) : string

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( mixed $entity_id, string $machine_name )
$entity_id mixed the id of the domain specific entity (it will internally be converted to a string)
$machine_name string the name of the statemachine (eg: 'order')

__toString() 공개 메소드

public __toString ( ) : string
리턴 string

getEntityId() 공개 메소드

gets the entity id that represents the unique identifier for the application domain specific model.
public getEntityId ( ) : string
리턴 string

getId() 공개 메소드

get the unique identifier representation for an Identifier, which consists of the machine name and the entity_id in parseable form.
public getId ( boolean $readable = false ) : string
$readable boolean human readable or not. defaults to false
리턴 string

getMachine() 공개 메소드

gets the statemachine name that handles the entity
public getMachine ( ) : string
리턴 string

setEntityId() 공개 메소드

set the id of the domain specific entity (it will internally be converted to a string)
public setEntityId ( mixed $entity_id )
$entity_id mixed

toString() 공개 메소드

public toString ( ) : string
리턴 string

프로퍼티 상세

$entity_id 보호되어 있는 프로퍼티

an entity id that represents the unique identifier for an application domain specific object (entity) like 'Order', 'Customer' etc.
protected string $entity_id
리턴 string

$machine_name 보호되어 있는 프로퍼티

this is the name of the statemachine itself and is used in conjunction with the entity_id to define what a statemachine is about.
protected string $machine_name
리턴 string