StateDefinition
StateDefinition entity - Define los estados posibles para una maquina de estados. Configuracion data-driven de los estados del pipeline. Cada dominio (opportunity, project) tiene su propio conjunto de estados ordenados, con marcadores de estado inicial y terminal.
StateDefinition::__construct()
public function __construct():StateDefinition::onPreUpdate()
public function onPreUpdate(): voidStateDefinition::getId()
public function getId(): intStateDefinition::getDomain()
public function getDomain(): stringStateDefinition::getCode()
public function getCode(): stringStateDefinition::getLabel()
public function getLabel(): stringStateDefinition::getDescription()
public function getDescription(): ?stringStateDefinition::getSortOrder()
public function getSortOrder(): intStateDefinition::isInitial()
public function isInitial(): boolStateDefinition::isTerminal()
public function isTerminal(): boolStateDefinition::getColor()
public function getColor(): stringStateDefinition::getMetadata()
public function getMetadata(): ?arrayStateDefinition::getCreatedAt()
public function getCreatedAt(): DateTimeStateDefinition::getUpdatedAt()
public function getUpdatedAt(): DateTimeStateDefinition::getTransitionsFrom()
public function getTransitionsFrom(): Doctrine\Common\Collections\CollectionStateDefinition::getTransitionsTo()
public function getTransitionsTo(): Doctrine\Common\Collections\CollectionStateDefinition::setDomain()
public function setDomain(string $domain): selfSets the domain this state belongs to (e.g. "opportunity", "project").
Parameters
| Name | Type | Description |
|---|---|---|
| $domain | string |
StateDefinition::setCode()
public function setCode(string $code): selfSets the state's unique code within its domain.
Parameters
| Name | Type | Description |
|---|---|---|
| $code | string |
StateDefinition::setLabel()
public function setLabel(string $label): selfSets the state's human-readable label.
Parameters
| Name | Type | Description |
|---|---|---|
| $label | string |
StateDefinition::setDescription()
public function setDescription(?string $description): selfSets the state's optional description.
Parameters
| Name | Type | Description |
|---|---|---|
| $description | ?string |
StateDefinition::setSortOrder()
public function setSortOrder(int $sortOrder): selfSets the state's display sort order within the pipeline.
Parameters
| Name | Type | Description |
|---|---|---|
| $sortOrder | int |
StateDefinition::setIsInitial()
public function setIsInitial(bool $isInitial): selfSets whether this is the domain's initial state.
Parameters
| Name | Type | Description |
|---|---|---|
| $isInitial | bool |
StateDefinition::setIsTerminal()
public function setIsTerminal(bool $isTerminal): selfSets whether this is a terminal state (end of the pipeline).
Parameters
| Name | Type | Description |
|---|---|---|
| $isTerminal | bool |
StateDefinition::setColor()
public function setColor(string $color): selfSets the state's display color.
Parameters
| Name | Type | Description |
|---|---|---|
| $color | string |
StateDefinition::setMetadata()
public function setMetadata(?array $metadata): selfSets additional metadata for the state.
Parameters
| Name | Type | Description |
|---|---|---|
| $metadata | (array<string, mixed> | null) |
StateDefinition::addTransitionFrom()
public function addTransitionFrom(Milpa\Workflow\Entities\TransitionDefinition $transition): selfAdds a transition originating from this state, wiring the inverse side back.
Parameters
| Name | Type | Description |
|---|---|---|
| $transition | Milpa\Workflow\Entities\TransitionDefinition |
StateDefinition::removeTransitionFrom()
public function removeTransitionFrom(Milpa\Workflow\Entities\TransitionDefinition $transition): selfRemoves a transition originating from this state, clearing the inverse side.
Parameters
| Name | Type | Description |
|---|---|---|
| $transition | Milpa\Workflow\Entities\TransitionDefinition |
StateDefinition::addTransitionTo()
public function addTransitionTo(Milpa\Workflow\Entities\TransitionDefinition $transition): selfAdds a transition arriving at this state, wiring the inverse side back.
Parameters
| Name | Type | Description |
|---|---|---|
| $transition | Milpa\Workflow\Entities\TransitionDefinition |
StateDefinition::removeTransitionTo()
public function removeTransitionTo(Milpa\Workflow\Entities\TransitionDefinition $transition): selfRemoves a transition arriving at this state, clearing the inverse side.
Parameters
| Name | Type | Description |
|---|---|---|
| $transition | Milpa\Workflow\Entities\TransitionDefinition |
StateDefinition::toArray()
public function toArray(): arrayConverts the entity to an array for API responses.