2020-02-07 10:27:07 +01:00
|
|
|
<?php
|
|
|
|
|
2022-09-16 13:53:49 +02:00
|
|
|
declare(strict_types=1);
|
2020-02-07 10:27:07 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2020 Daniel Siepmann <coding@daniel-siepmann.de>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
* 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
2022-09-16 13:53:49 +02:00
|
|
|
namespace DanielSiepmann\Tracking\Domain\Model;
|
|
|
|
|
2022-12-07 13:37:19 +01:00
|
|
|
use DateTimeImmutable;
|
2020-02-07 10:27:07 +01:00
|
|
|
use TYPO3\CMS\Core\Site\Entity\SiteLanguage;
|
|
|
|
|
2020-07-29 10:07:14 +02:00
|
|
|
class Pageview implements HasUserAgent
|
2020-02-07 10:27:07 +01:00
|
|
|
{
|
2020-04-01 21:04:32 +02:00
|
|
|
/**
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
private $uid = 0;
|
|
|
|
|
2020-02-07 10:27:07 +01:00
|
|
|
/**
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
private $pageUid;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var SiteLanguage
|
|
|
|
*/
|
|
|
|
private $language;
|
|
|
|
|
|
|
|
/**
|
2022-12-07 13:37:19 +01:00
|
|
|
* @var DateTimeImmutable
|
2020-02-07 10:27:07 +01:00
|
|
|
*/
|
|
|
|
private $crdate;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
private $pageType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $url;
|
|
|
|
|
2020-02-13 12:26:19 +01:00
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $userAgent;
|
|
|
|
|
2020-02-07 10:27:07 +01:00
|
|
|
public function __construct(
|
|
|
|
int $pageUid,
|
|
|
|
SiteLanguage $language,
|
2022-12-07 13:37:19 +01:00
|
|
|
DateTimeImmutable $crdate,
|
2020-02-07 10:27:07 +01:00
|
|
|
int $pageType,
|
2020-02-13 12:26:19 +01:00
|
|
|
string $url,
|
2020-04-01 21:04:32 +02:00
|
|
|
string $userAgent,
|
|
|
|
int $uid = 0
|
2020-02-07 10:27:07 +01:00
|
|
|
) {
|
2020-04-01 21:04:32 +02:00
|
|
|
$this->uid = $uid;
|
2020-02-07 10:27:07 +01:00
|
|
|
$this->pageUid = $pageUid;
|
|
|
|
$this->language = $language;
|
|
|
|
$this->crdate = $crdate;
|
|
|
|
$this->pageType = $pageType;
|
|
|
|
$this->url = $url;
|
2020-02-13 12:26:19 +01:00
|
|
|
$this->userAgent = $userAgent;
|
2020-02-07 10:27:07 +01:00
|
|
|
}
|
|
|
|
|
2020-04-01 21:04:32 +02:00
|
|
|
public function getUid(): int
|
|
|
|
{
|
|
|
|
return $this->uid;
|
|
|
|
}
|
|
|
|
|
2020-02-07 10:27:07 +01:00
|
|
|
public function getPageUid(): int
|
|
|
|
{
|
|
|
|
return $this->pageUid;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getLanguage(): SiteLanguage
|
|
|
|
{
|
|
|
|
return $this->language;
|
|
|
|
}
|
|
|
|
|
2022-12-07 13:37:19 +01:00
|
|
|
public function getCrdate(): DateTimeImmutable
|
2020-02-07 10:27:07 +01:00
|
|
|
{
|
|
|
|
return $this->crdate;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getPageType(): int
|
|
|
|
{
|
|
|
|
return $this->pageType;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getUrl(): string
|
|
|
|
{
|
|
|
|
return $this->url;
|
|
|
|
}
|
2020-02-13 12:26:19 +01:00
|
|
|
|
|
|
|
public function getUserAgent(): string
|
|
|
|
{
|
|
|
|
return $this->userAgent;
|
|
|
|
}
|
2020-04-01 21:04:32 +02:00
|
|
|
|
|
|
|
public function getOperatingSystem(): string
|
|
|
|
{
|
2020-07-29 10:07:14 +02:00
|
|
|
return Extractor::getOperatingSystem($this);
|
2020-04-01 21:04:32 +02:00
|
|
|
}
|
2020-02-07 10:27:07 +01:00
|
|
|
}
|