1 | <?php |
||
31 | 1 | final class Helpers |
|
32 | { |
||
33 | /** |
||
34 | * Implement nette smart magic |
||
35 | */ |
||
36 | 1 | use Nette\SmartObject; |
|
37 | |||
38 | /** |
||
39 | * @var MobileDetect\MobileDetect |
||
40 | */ |
||
41 | private $mobileDetect; |
||
42 | |||
43 | /** |
||
44 | * @var MobileDetect\Helpers\DeviceView |
||
45 | */ |
||
46 | private $deviceView; |
||
47 | |||
48 | /** |
||
49 | * @param MobileDetect\MobileDetect $mobileDetect |
||
50 | * @param MobileDetect\Helpers\DeviceView $deviceView |
||
51 | */ |
||
52 | public function __construct( |
||
59 | |||
60 | /** |
||
61 | * @return MobileDetect\MobileDetect |
||
62 | */ |
||
63 | public function getMobileDetectService() : MobileDetect\MobileDetect |
||
67 | |||
68 | /** |
||
69 | * @return MobileDetect\Helpers\DeviceView |
||
70 | */ |
||
71 | public function getDeviceViewService() : MobileDetect\Helpers\DeviceView |
||
75 | |||
76 | /** |
||
77 | * @return bool |
||
78 | */ |
||
79 | public function isMobile() : bool |
||
83 | |||
84 | /** |
||
85 | * @return bool |
||
86 | */ |
||
87 | public function isPhone() : bool |
||
91 | |||
92 | /** |
||
93 | * @return bool |
||
94 | */ |
||
95 | public function isTablet() : bool |
||
99 | |||
100 | /** |
||
101 | * @param string $device |
||
102 | * |
||
103 | * @return bool |
||
104 | */ |
||
105 | public function isDevice(string $device) : bool |
||
109 | |||
110 | /** |
||
111 | * @param string $os |
||
112 | * |
||
113 | * @return bool |
||
114 | */ |
||
115 | public function isOs(string $os) : bool |
||
119 | |||
120 | /** |
||
121 | * @return bool |
||
122 | */ |
||
123 | public function isFullView() : bool |
||
127 | |||
128 | /** |
||
129 | * @return bool |
||
130 | */ |
||
131 | public function isMobileView() : bool |
||
135 | |||
136 | /** |
||
137 | * @return bool |
||
138 | */ |
||
139 | public function isPhoneView() : bool |
||
143 | |||
144 | /** |
||
145 | * @return bool |
||
146 | */ |
||
147 | public function isTabletView() : bool |
||
151 | |||
152 | /** |
||
153 | * @return bool |
||
154 | */ |
||
155 | public function isNotMobileView() : bool |
||
159 | } |
||
160 |