-
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathProjectionPartitionState.php
More file actions
36 lines (30 loc) · 1.23 KB
/
ProjectionPartitionState.php
File metadata and controls
36 lines (30 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/*
* licence Enterprise
*/
declare(strict_types=1);
namespace Ecotone\Projecting;
class ProjectionPartitionState
{
public function __construct(
public readonly string $projectionName,
public readonly ?string $partitionKey,
public readonly string $streamName,
public readonly ?string $lastPosition = null,
public readonly mixed $userState = null,
public readonly ?ProjectionInitializationStatus $status = null,
) {
}
public function withLastPosition(string $lastPosition): self
{
return new self($this->projectionName, $this->partitionKey, $this->streamName, $lastPosition, $this->userState, $this->status);
}
public function withUserState(mixed $userState): self
{
return new self($this->projectionName, $this->partitionKey, $this->streamName, $this->lastPosition, $userState, $this->status);
}
public function withStatus(ProjectionInitializationStatus $status): self
{
return new self($this->projectionName, $this->partitionKey, $this->streamName, $this->lastPosition, $this->userState, $status);
}
}