@@ 15-27 (lines=13) @@ | ||
12 | { |
|
13 | protected $storedEventModel = EloquentStoredEvent::class; |
|
14 | ||
15 | public function retrieveAll(string $uuid = null): LazyCollection |
|
16 | { |
|
17 | /** @var \Illuminate\Database\Query\Builder $query */ |
|
18 | $query = $this->storedEventModel::query(); |
|
19 | ||
20 | if ($uuid) { |
|
21 | $query->uuid($uuid); |
|
22 | } |
|
23 | ||
24 | return $query->cursor()->map(function (EloquentStoredEvent $storedEvent) { |
|
25 | return $storedEvent->toStoredEvent(); |
|
26 | }); |
|
27 | } |
|
28 | ||
29 | public function retrieveAllStartingFrom(int $startingFrom, string $uuid = null): LazyCollection |
|
30 | { |
|
@@ 29-41 (lines=13) @@ | ||
26 | }); |
|
27 | } |
|
28 | ||
29 | public function retrieveAllStartingFrom(int $startingFrom, string $uuid = null): LazyCollection |
|
30 | { |
|
31 | /** @var \Illuminate\Database\Query\Builder $query */ |
|
32 | $query = $this->storedEventModel::query()->startingFrom($startingFrom); |
|
33 | ||
34 | if ($uuid) { |
|
35 | $query->uuid($uuid); |
|
36 | } |
|
37 | ||
38 | return $query->cursor()->map(function (EloquentStoredEvent $storedEvent) { |
|
39 | return $storedEvent->toStoredEvent(); |
|
40 | }); |
|
41 | } |
|
42 | ||
43 | public function persist(ShouldBeStored $event, string $uuid = null): StoredEvent |
|
44 | { |