1 | <?php |
||
21 | class TenantResolver implements TenantResolverInterface |
||
22 | { |
||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | private $domain; |
||
27 | |||
28 | /** |
||
29 | * @var TenantRepositoryInterface |
||
30 | */ |
||
31 | private $tenantRepository; |
||
32 | |||
33 | /** |
||
34 | * Construct. |
||
35 | * |
||
36 | * @param string $domain |
||
37 | * @param TenantRepositoryInterface $tenantRepository |
||
38 | */ |
||
39 | public function __construct($domain, TenantRepositoryInterface $tenantRepository) |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function resolve($host = null) |
||
59 | |||
60 | /** |
||
61 | * Extracts subdomain from the host. |
||
62 | * |
||
63 | * @param string $host Hostname |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | protected function extractSubdomain($host) |
||
81 | } |
||
82 |