From ce2b97e650899e781f4010eb7d9f951b6bea8d82 Mon Sep 17 00:00:00 2001 From: hdoerner Date: Fri, 9 Oct 2020 14:31:47 +0200 Subject: [PATCH 1/2] Add new methods to interface --- src/EventStore.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/EventStore.php b/src/EventStore.php index ef19318..4cfeec3 100644 --- a/src/EventStore.php +++ b/src/EventStore.php @@ -50,4 +50,20 @@ public function loadEventsByCorrelationId(string $streamName, string $correlatio * @return \Iterator GenericEvent[] */ public function loadEventsByCausationId(string $streamName, string $causationId): \Iterator; + + /** + * @param string $streamName + * @param int $skip + * @param int $limit + * @return \Iterator + */ + public function loadStreamEvents(string $streamName, int $skip, int $limit): \Iterator; + + /** + * @param string $streamName + * @param int $skip + * @param int $limit + * @return \Iterator + */ + public function loadStreamEventsReverse(string $streamName, int $skip, int $limit): \Iterator; } From e19f498a58191e24ac2564bb27912c22f5e73ce1 Mon Sep 17 00:00:00 2001 From: hdoerner Date: Thu, 15 Oct 2020 19:32:58 +0200 Subject: [PATCH 2/2] Add default values for skip & limit --- src/EventStore.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/EventStore.php b/src/EventStore.php index 4cfeec3..9869f43 100644 --- a/src/EventStore.php +++ b/src/EventStore.php @@ -54,16 +54,16 @@ public function loadEventsByCausationId(string $streamName, string $causationId) /** * @param string $streamName * @param int $skip - * @param int $limit + * @param int|null $limit * @return \Iterator */ - public function loadStreamEvents(string $streamName, int $skip, int $limit): \Iterator; + public function loadStreamEvents(string $streamName, int $skip = 0, int $limit = null): \Iterator; /** * @param string $streamName * @param int $skip - * @param int $limit + * @param int|null $limit * @return \Iterator */ - public function loadStreamEventsReverse(string $streamName, int $skip, int $limit): \Iterator; + public function loadStreamEventsReverse(string $streamName, int $skip = 0, int $limit = null): \Iterator; }