1 | <?php |
||
13 | class VisitsTracker implements VisitsTrackerInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var EntityManagerInterface |
||
17 | */ |
||
18 | private $em; |
||
19 | |||
20 | /** |
||
21 | * VisitsTracker constructor. |
||
22 | * @param EntityManagerInterface $em |
||
23 | * |
||
24 | * @Inject({"em"}) |
||
25 | */ |
||
26 | 3 | public function __construct(EntityManagerInterface $em) |
|
30 | |||
31 | /** |
||
32 | * Tracks a new visit to provided short code, using an array of data to look up information |
||
33 | * |
||
34 | * @param string $shortCode |
||
35 | * @param ServerRequestInterface $request |
||
36 | */ |
||
37 | 2 | public function track($shortCode, ServerRequestInterface $request) |
|
52 | |||
53 | /** |
||
54 | * @param ServerRequestInterface $request |
||
55 | * @return string |
||
56 | */ |
||
57 | 2 | protected function findOutRemoteAddr(ServerRequestInterface $request) |
|
68 | |||
69 | /** |
||
70 | * Returns the visits on certain short code |
||
71 | * |
||
72 | * @param $shortCode |
||
73 | * @param DateRange $dateRange |
||
74 | * @return Visit[] |
||
75 | */ |
||
76 | 1 | public function info($shortCode, DateRange $dateRange = null) |
|
90 | } |
||
91 |