<?php
namespace App\Entity;
use App\Admin\Entity\StdPages;
use App\Admin\Entity\StdPagesTag;
use App\Admin\Entity\StdWebUsers;
use App\Repository\StdPagesTrackingRepository;
use App\Repository\StdTagTrackingRepository;
use Doctrine\ORM\Mapping as ORM;
use App\Admin\Enum\TrackingEvent;
#[ORM\Entity(repositoryClass: StdPagesTrackingRepository::class)]
#[ORM\Index(name: 'idx_tracking_id', columns: ['tracking_id'])]
#[ORM\Index(name: 'idx_visited_at', columns: ['visited_at'])]
#[ORM\Index(name: 'idx_hashed_ip', columns: ['hashed_ip'])]
#[ORM\Index(name: 'idx_event', columns: ['event'])]
#[ORM\Index(name: 'idx_tracking_page_event', columns: ['tracking_id', 'page_id', 'event'])]
#[ORM\Index(name: 'idx_hashed_ip_visited', columns: ['hashed_ip', 'visited_at'])]
class StdPagesTracking
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column]
private ?\DateTimeImmutable $visitedAt = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $sessionHash = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $trackingId = null;
#[ORM\ManyToOne(targetEntity: StdPages::class, inversedBy: 'trackings')]
private ?StdPages $page = null;
#[ORM\Column(length: 255)]
private ?string $hashedIp = null;
#[ORM\Column(length: 255)]
private ?string $fingerprint = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $country = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $city = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $preciseCountry = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $preciseCity = null;
#[ORM\ManyToOne(inversedBy: 'pageTrackings')]
private ?StdWebUsers $webUser = null;
#[ORM\Column(name: 'event', type: 'string', length: 60, nullable: true, options: ['default' => TrackingEvent::OpenPage->value])]
private ?string $event = TrackingEvent::OpenPage->value;
public function getId(): ?int
{
return $this->id;
}
public function getVisitedAt(): ?\DateTimeImmutable
{
return $this->visitedAt;
}
public function setVisitedAt(\DateTimeImmutable $visitedAt): static
{
$this->visitedAt = $visitedAt;
return $this;
}
public function getSessionHash(): ?string
{
return $this->sessionHash;
}
public function setSessionHash(?string $sessionHash): static
{
$this->sessionHash = $sessionHash;
return $this;
}
public function getTrackingId(): ?string
{
return $this->trackingId;
}
public function setTrackingId(?string $trackingId): static
{
$this->trackingId = $trackingId;
return $this;
}
public function getPage(): ?StdPages
{
return $this->page;
}
public function setPage(?StdPages $page): void
{
$this->page = $page;
}
public function getHashedIp(): ?string
{
return $this->hashedIp;
}
public function setHashedIp(string $hashedIp): static
{
$this->hashedIp = $hashedIp;
return $this;
}
public function getFingerprint(): ?string
{
return $this->fingerprint;
}
public function setFingerprint(string $fingerprint): static
{
$this->fingerprint = $fingerprint;
return $this;
}
public function getCountry(): ?string
{
return $this->country;
}
public function setCountry(?string $country): static
{
$this->country = $country;
return $this;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(?string $city): static
{
$this->city = $city;
return $this;
}
public function getPreciseCountry(): ?string
{
return $this->preciseCountry;
}
public function setPreciseCountry(?string $preciseCountry): void
{
$this->preciseCountry = $preciseCountry;
}
public function getPreciseCity(): ?string
{
return $this->preciseCity;
}
public function setPreciseCity(?string $preciseCity): void
{
$this->preciseCity = $preciseCity;
}
public function getWebUser(): ?StdWebUsers
{
return $this->webUser;
}
public function setWebUser(?StdWebUsers $webUser): static
{
$this->webUser = $webUser;
return $this;
}
public function getEvent(): ?string
{
return $this->event;
}
public function setEvent(?string $event): self
{
$this->event = $event;
return $this;
}
}