1 | <?php |
||
10 | class UserAgent |
||
11 | { |
||
12 | /** |
||
13 | * @var Browser |
||
14 | */ |
||
15 | private $browser; |
||
16 | |||
17 | /** |
||
18 | * @var RenderingEngine |
||
19 | */ |
||
20 | private $renderingEngine; |
||
21 | |||
22 | /** |
||
23 | * @var OperatingSystem |
||
24 | */ |
||
25 | private $operatingSystem; |
||
26 | |||
27 | /** |
||
28 | * @var Device |
||
29 | */ |
||
30 | private $device; |
||
31 | |||
32 | /** |
||
33 | * @var Bot |
||
34 | */ |
||
35 | private $bot; |
||
36 | |||
37 | /** |
||
38 | * @var mixed |
||
39 | */ |
||
40 | private $providerResultRaw; |
||
41 | |||
42 | 9 | public function __construct() |
|
50 | |||
51 | /** |
||
52 | * @param Browser $browser |
||
53 | */ |
||
54 | 1 | public function setBrowser(Browser $browser) |
|
58 | |||
59 | /** |
||
60 | * @return Browser |
||
61 | */ |
||
62 | 2 | public function getBrowser() |
|
66 | |||
67 | /** |
||
68 | * @param RenderingEngine $renderingEngine |
||
69 | */ |
||
70 | 1 | public function setRenderingEngine(RenderingEngine $renderingEngine) |
|
74 | |||
75 | /** |
||
76 | * @return RenderingEngine |
||
77 | */ |
||
78 | 2 | public function getRenderingEngine() |
|
82 | |||
83 | /** |
||
84 | * @param OperatingSystem $operatingSystem |
||
85 | */ |
||
86 | 1 | public function setOperatingSystem(OperatingSystem $operatingSystem) |
|
90 | |||
91 | /** |
||
92 | * @return OperatingSystem |
||
93 | */ |
||
94 | 2 | public function getOperatingSystem() |
|
98 | |||
99 | /** |
||
100 | * @param Device $device |
||
101 | */ |
||
102 | 1 | public function setDevice(Device $device) |
|
106 | |||
107 | /** |
||
108 | * @return Device |
||
109 | */ |
||
110 | 3 | public function getDevice() |
|
114 | |||
115 | /** |
||
116 | * @param Bot $bot |
||
117 | */ |
||
118 | 1 | public function setBot(Bot $bot) |
|
122 | |||
123 | /** |
||
124 | * @return Bot |
||
125 | */ |
||
126 | 3 | public function getBot() |
|
130 | |||
131 | /** |
||
132 | * |
||
133 | * @return boolean |
||
134 | */ |
||
135 | 1 | public function isBot() |
|
136 | { |
||
137 | 1 | if ($this->getBot()->getIsBot() === true) { |
|
138 | 1 | return true; |
|
139 | } |
||
140 | |||
141 | 1 | return false; |
|
142 | } |
||
143 | |||
144 | /** |
||
145 | * |
||
146 | * @return boolean |
||
147 | */ |
||
148 | 1 | public function isMobile() |
|
149 | { |
||
150 | 1 | if ($this->getDevice()->getIsMobile() === true) { |
|
151 | 1 | return true; |
|
152 | } |
||
153 | |||
154 | 1 | return false; |
|
155 | } |
||
156 | |||
157 | /** |
||
158 | * @param mixed $providerResultRaw |
||
159 | */ |
||
160 | 1 | public function setProviderResultRaw($providerResultRaw) |
|
164 | |||
165 | /** |
||
166 | * @return mixed |
||
167 | */ |
||
168 | 2 | public function getProviderResultRaw() |
|
172 | |||
173 | /** |
||
174 | * @return array |
||
175 | */ |
||
176 | 1 | public function toArray($includeResultRaw = false) |
|
193 | } |
||
194 |