1 | <?php |
||
24 | class TenantResolver implements TenantResolverInterface |
||
25 | { |
||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | private $domain; |
||
30 | |||
31 | /** |
||
32 | * @var TenantRepositoryInterface |
||
33 | */ |
||
34 | private $tenantRepository; |
||
35 | |||
36 | /** |
||
37 | * Construct. |
||
38 | * |
||
39 | * @param string $domain |
||
40 | * @param TenantRepositoryInterface $tenantRepository |
||
41 | */ |
||
42 | public function __construct($domain, TenantRepositoryInterface $tenantRepository) |
||
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | public function resolve($host = null) |
||
63 | |||
64 | /** |
||
65 | * Extracts subdomain from the host. |
||
66 | * |
||
67 | * @param string $host Hostname |
||
68 | * |
||
69 | * @return string |
||
70 | */ |
||
71 | protected function extractSubdomain($host) |
||
85 | |||
86 | /** |
||
87 | * @param TenantInterface|null $tenant |
||
88 | * |
||
89 | * @throws TenantNotFoundException |
||
90 | */ |
||
91 | private function assertTenantIsFound(TenantInterface $tenant = null) |
||
97 | } |
||
98 |