1 | <?php |
||
22 | class TenantResolver implements TenantResolverInterface |
||
23 | { |
||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $domain; |
||
28 | |||
29 | /** |
||
30 | * @var TenantRepositoryInterface |
||
31 | */ |
||
32 | private $tenantRepository; |
||
33 | |||
34 | /** |
||
35 | * Construct. |
||
36 | * |
||
37 | * @param string $domain |
||
38 | * @param TenantRepositoryInterface $tenantRepository |
||
39 | */ |
||
40 | public function __construct($domain, TenantRepositoryInterface $tenantRepository) |
||
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | public function resolve($host = null) |
||
64 | |||
65 | /** |
||
66 | * Extracts subdomain from the host. |
||
67 | * |
||
68 | * @param string $host Hostname |
||
69 | * |
||
70 | * @return string |
||
71 | */ |
||
72 | protected function extractSubdomain($host) |
||
86 | } |
||
87 |