Skip to content

Commit 3957d4a

Browse files
authored
Refactor ParentWorkflow to use status instead of approvalStatus
1 parent ff9fa4b commit 3957d4a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/features/child-workflows.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ use Workflow\WorkflowStub;
9494
class ParentWorkflow extends Workflow
9595
{
9696
private bool $processed = false;
97-
private ?string $approvalStatus = null;
97+
private ?string $status = null;
9898

9999
#[SignalMethod]
100100
public function process(string $status): void
101101
{
102102
$this->processed = true;
103-
$this->approvalStatus = $status;
103+
$this->status = $status;
104104
}
105105

106106
public function execute()
@@ -111,7 +111,7 @@ class ParentWorkflow extends Workflow
111111

112112
yield WorkflowStub::await(fn () => $this->processed);
113113

114-
$childHandle->process($this->approvalStatus);
114+
$childHandle->process($this->status);
115115

116116
$result = yield $child;
117117

@@ -154,7 +154,7 @@ class ParentWorkflow extends Workflow
154154
private ?int $childId = null;
155155

156156
#[QueryMethod]
157-
public function getChildId(): ?int
157+
public function childId(): ?int
158158
{
159159
return $this->childId;
160160
}
@@ -176,7 +176,7 @@ Then you can interact with the child workflow directly.
176176

177177
```php
178178
$workflow = WorkflowStub::load($workflowId);
179-
$childWorkflow = WorkflowStub::load($workflow->getChildId());
179+
$childWorkflow = WorkflowStub::load($workflow->childId());
180180
$childWorkflow->approve('approved');
181181
```
182182

0 commit comments

Comments
 (0)