Added event dispatcher to track when a short URL is visited

This commit is contained in:
Alejandro Celaya
2019-07-13 12:04:21 +02:00
parent 014eb2a924
commit 91698034e7
16 changed files with 488 additions and 8 deletions

View File

@@ -65,6 +65,11 @@ class Visit extends AbstractEntity implements JsonSerializable
return $this->visitLocation ?? new UnknownVisitLocation();
}
public function isLocatable(): bool
{
return $this->hasRemoteAddr() && $this->remoteAddr !== IpAddress::LOCALHOST;
}
public function locate(VisitLocation $visitLocation): self
{
$this->visitLocation = $visitLocation;