|
17 | 17 | use Patchlevel\EventSourcing\Subscription\RetryStrategy\RetryStrategy; |
18 | 18 | use Patchlevel\EventSourcing\Subscription\Subscriber\ArgumentResolver\ArgumentResolver; |
19 | 19 | use Patchlevel\Hydrator\Extension; |
| 20 | +use Patchlevel\Hydrator\Guesser\Guesser; |
20 | 21 | use Throwable; |
21 | 22 |
|
22 | 23 | use function array_values; |
@@ -218,6 +219,9 @@ final class Configuration |
218 | 219 | /** @var StoreOptions */ |
219 | 220 | public array $storeMigrationOptions = []; |
220 | 221 |
|
| 222 | + /** @var array<Guesser> */ |
| 223 | + public array $guesser = []; |
| 224 | + |
221 | 225 | public function withAggregates(string ...$aggregates): self |
222 | 226 | { |
223 | 227 | $newConfiguration = clone $this; |
@@ -383,18 +387,23 @@ public function withSnapshotAdapters(array $snapshotAdapters): self |
383 | 387 | return $newConfiguration; |
384 | 388 | } |
385 | 389 |
|
386 | | - public function withHydratorDefaultLazy(bool $hydratorDefaultLazy): self |
| 390 | + /** |
| 391 | + * @param array<Guesser> $guesser |
| 392 | + */ |
| 393 | + public function withLegacyHydrator(array $guesser = []): self |
387 | 394 | { |
388 | 395 | $newConfiguration = clone $this; |
389 | | - $newConfiguration->hydratorDefaultLazy = $hydratorDefaultLazy; |
| 396 | + $newConfiguration->hydratorMode = self::HYDRATOR_MODE_LEGACY; |
| 397 | + $newConfiguration->guesser = $guesser; |
390 | 398 |
|
391 | 399 | return $newConfiguration; |
392 | 400 | } |
393 | 401 |
|
394 | | - public function withHydratorMode(string $hydratorMode): self |
| 402 | + |
| 403 | + public function withLazyHydrator(bool $hydratorDefaultLazy): self |
395 | 404 | { |
396 | 405 | $newConfiguration = clone $this; |
397 | | - $newConfiguration->hydratorMode = $hydratorMode; |
| 406 | + $newConfiguration->hydratorDefaultLazy = $hydratorDefaultLazy; |
398 | 407 |
|
399 | 408 | return $newConfiguration; |
400 | 409 | } |
|
0 commit comments