2016-04-17 13:42:52 +02:00
|
|
|
<?php
|
|
|
|
|
namespace Acelaya\UrlShortener\Service;
|
|
|
|
|
|
2016-06-12 21:51:06 +02:00
|
|
|
use Acelaya\UrlShortener\Entity\Visit;
|
2016-07-04 08:57:37 +02:00
|
|
|
use Zend\Paginator\Paginator;
|
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
|
|
|
|
|
* @param array $visitorData Defaults to global $_SERVER
|
|
|
|
|
*/
|
|
|
|
|
public function track($shortCode, array $visitorData = null);
|
2016-06-12 21:51:06 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the visits on certain shortcode
|
|
|
|
|
*
|
|
|
|
|
* @param $shortCode
|
2016-07-04 08:57:37 +02:00
|
|
|
* @return Paginator|Visit[]
|
2016-06-12 21:51:06 +02:00
|
|
|
*/
|
|
|
|
|
public function info($shortCode);
|
2016-04-17 13:42:52 +02:00
|
|
|
}
|