2016-04-17 13:42:52 +02:00
|
|
|
<?php
|
2016-07-19 18:01:39 +02:00
|
|
|
namespace Shlinkio\Shlink\Core\Service;
|
2016-04-17 13:42:52 +02:00
|
|
|
|
2016-08-09 08:52:06 +02:00
|
|
|
use Psr\Http\Message\ServerRequestInterface;
|
2016-07-21 09:36:38 +02:00
|
|
|
use Shlinkio\Shlink\Common\Util\DateRange;
|
2016-07-19 18:01:39 +02:00
|
|
|
use Shlinkio\Shlink\Core\Entity\Visit;
|
2016-06-12 21:51:06 +02:00
|
|
|
|
2016-04-17 13:42:52 +02:00
|
|
|
interface VisitsTrackerInterface
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Tracks a new visit to provided short code, using an array of data to look up information
|
|
|
|
|
*
|
|
|
|
|
* @param string $shortCode
|
2016-08-09 08:52:06 +02:00
|
|
|
* @param ServerRequestInterface $request
|
|
|
|
|
* @return
|
2016-04-17 13:42:52 +02:00
|
|
|
*/
|
2016-08-09 08:52:06 +02:00
|
|
|
public function track($shortCode, ServerRequestInterface $request);
|
2016-06-12 21:51:06 +02:00
|
|
|
|
|
|
|
|
/**
|
2016-07-21 09:36:38 +02:00
|
|
|
* Returns the visits on certain short code
|
2016-06-12 21:51:06 +02:00
|
|
|
*
|
|
|
|
|
* @param $shortCode
|
2016-07-21 09:36:38 +02:00
|
|
|
* @param DateRange $dateRange
|
|
|
|
|
* @return Visit[]
|
2016-06-12 21:51:06 +02:00
|
|
|
*/
|
2016-07-21 09:36:38 +02:00
|
|
|
public function info($shortCode, DateRange $dateRange = null);
|
2016-04-17 13:42:52 +02:00
|
|
|
}
|