Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | namespace Drupal\visitors; |
| 4 | |
| 5 | /** |
| 6 | * Interface for tracker visitors. |
| 7 | */ |
| 8 | interface VisitorsTrackerInterface { |
| 9 | |
| 10 | /** |
| 11 | * The session timeout in seconds. |
| 12 | * |
| 13 | * It is 30 minutes. |
| 14 | */ |
| 15 | const SESSION_TIMEOUT = 1800; |
| 16 | |
| 17 | /** |
| 18 | * Writes the event. |
| 19 | * |
| 20 | * @param string[] $fields |
| 21 | * The fields array. |
| 22 | * |
| 23 | * @return int |
| 24 | * The id of row created. |
| 25 | */ |
| 26 | public function writeEvent(array $fields): int; |
| 27 | |
| 28 | /** |
| 29 | * Gets the visit id. |
| 30 | * |
| 31 | * @param string[] $fields |
| 32 | * The fields array. |
| 33 | * @param int $request_time |
| 34 | * The request time. |
| 35 | * |
| 36 | * @return int |
| 37 | * The visit id. |
| 38 | */ |
| 39 | public function getVisitId(array $fields, int $request_time): int; |
| 40 | |
| 41 | /** |
| 42 | * Updates the visit. |
| 43 | * |
| 44 | * @param int $visit_id |
| 45 | * The visit id. |
| 46 | * @param int $event_id |
| 47 | * The event id. |
| 48 | * @param int $exit_time |
| 49 | * The exit time. |
| 50 | * @param int|null $uid |
| 51 | * The user id. |
| 52 | */ |
| 53 | public function updateVisit(int $visit_id, int $event_id, int $exit_time, ?int $uid); |
| 54 | |
| 55 | } |