1: <?php
2:
3: namespace LaravelUi5\Core\Contracts;
4:
5: /**
6: * Interface BusinessPartnerResolverInterface
7: *
8: * This interface defines the mechanism for resolving a BusinessPartner instance
9: * by its primary key (e.g., for impersonation, runtime context construction, etc.).
10: *
11: * It is designed to decouple the core framework from any specific BusinessPartner model
12: * or ORM implementation.
13: *
14: * Packages that implement BusinessPartner functionality (e.g. a User or Employee model)
15: * should register their resolver in the application configuration.
16: *
17: * Configuration example (`config/ui5.php`):
18: *
19: * 'business_partner_resolver' => \App\Resolvers\MyBusinessPartnerResolver::class,
20: *
21: * A default fallback resolver is provided in Core that always returns `null`.
22: */
23: interface BusinessPartnerResolverInterface
24: {
25: /**
26: * Resolve a BusinessPartner instance by its ID.
27: *
28: * @param int $id
29: * @return BusinessPartnerInterface|null
30: */
31: public function resolveById(int $id): ?BusinessPartnerInterface;
32: }
33: