-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
317d8a1
commit f3737f0
Showing
19 changed files
with
423 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Wwwision\DCBEventStore\Types; | ||
|
||
use Wwwision\DCBEventStore\EventStore; | ||
|
||
/** | ||
* Condition for {@see EventStore::read()} and {@see EventStore::readAll()} | ||
*/ | ||
final class ReadOptions | ||
{ | ||
/** | ||
* @param SequenceNumber|null $from If specified, only events with the given {@see SequenceNumber} or a higher (lower if backwards) one will be returned | ||
* @param bool $backwards If true, events will be returned in descending order, otherwise in the order they were appended | ||
*/ | ||
private function __construct( | ||
public readonly ?SequenceNumber $from, | ||
public bool $backwards, | ||
) { | ||
} | ||
|
||
public static function create( | ||
?SequenceNumber $from = null, | ||
bool $backwards = null, | ||
): self { | ||
return new self( | ||
$from, | ||
$backwards ?? false, | ||
); | ||
} | ||
|
||
public function with( | ||
?SequenceNumber $from = null, | ||
bool $backwards = null, | ||
): self { | ||
return new self( | ||
$from ?? $this->from, | ||
$backwards ?? $this->backwards, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.