|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace LD\LanguageDetection\Domain\Model\Dto; |
|
6
|
|
|
|
|
7
|
|
|
class SiteConfiguration |
|
8
|
|
|
{ |
|
9
|
|
|
protected bool $enableLanguageDetection; |
|
10
|
|
|
|
|
11
|
|
|
protected bool $disableRedirectWithBackendSession; |
|
12
|
|
|
|
|
13
|
|
|
protected string $addIpLocationToBrowserLanguage; |
|
14
|
|
|
|
|
15
|
|
|
protected bool $allowAllPaths; |
|
16
|
|
|
|
|
17
|
|
|
protected int $redirectHttpStatusCode; |
|
18
|
|
|
|
|
19
|
|
|
protected string $forwardRedirectParameters; |
|
20
|
|
|
|
|
21
|
|
|
protected int $fallbackDetectionLanguage; |
|
22
|
|
|
|
|
23
|
|
|
public function __construct( |
|
24
|
|
|
$enableLanguageDetection, |
|
25
|
|
|
$disableRedirectWithBackendSession, |
|
26
|
|
|
$addIpLocationToBrowserLanguage, |
|
27
|
|
|
$allowAllPaths, |
|
28
|
|
|
$redirectHttpStatusCode, |
|
29
|
|
|
$forwardRedirectParameters, |
|
30
|
|
|
$fallbackDetectionLanguage |
|
31
|
|
|
) { |
|
32
|
|
|
$this->enableLanguageDetection = (bool)$enableLanguageDetection; |
|
33
|
|
|
$this->disableRedirectWithBackendSession = (bool)$disableRedirectWithBackendSession; |
|
34
|
|
|
$this->addIpLocationToBrowserLanguage = (string)$addIpLocationToBrowserLanguage; |
|
35
|
|
|
$this->allowAllPaths = (bool)$allowAllPaths; |
|
36
|
|
|
$this->redirectHttpStatusCode = (int)$redirectHttpStatusCode; |
|
37
|
|
|
$this->forwardRedirectParameters = (string)$forwardRedirectParameters; |
|
38
|
|
|
$this->fallbackDetectionLanguage = (int)$fallbackDetectionLanguage; |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
public function isEnableLanguageDetection(): bool |
|
42
|
|
|
{ |
|
43
|
|
|
return $this->enableLanguageDetection; |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
public function isDisableRedirectWithBackendSession(): bool |
|
47
|
|
|
{ |
|
48
|
|
|
return $this->disableRedirectWithBackendSession; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
public function getAddIpLocationToBrowserLanguage(): string |
|
52
|
|
|
{ |
|
53
|
|
|
return $this->addIpLocationToBrowserLanguage; |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
public function isAllowAllPaths(): bool |
|
57
|
|
|
{ |
|
58
|
|
|
return $this->allowAllPaths; |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
public function getRedirectHttpStatusCode(): int |
|
62
|
|
|
{ |
|
63
|
|
|
return $this->redirectHttpStatusCode; |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
public function getForwardRedirectParameters(): string |
|
67
|
|
|
{ |
|
68
|
|
|
return $this->forwardRedirectParameters; |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
public function getFallbackDetectionLanguage(): int |
|
72
|
|
|
{ |
|
73
|
|
|
return $this->fallbackDetectionLanguage; |
|
74
|
|
|
} |
|
75
|
|
|
} |
|
76
|
|
|
|