Skip to content

Commit d622160

Browse files
committed
analytics
1 parent 0f0a5c0 commit d622160

10 files changed

+634
-0
lines changed
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PhpList\Core\Domain\Model\Analytics;
6+
7+
use DateTimeInterface;
8+
use Doctrine\ORM\Mapping as ORM;
9+
use PhpList\Core\Domain\Model\Interfaces\DomainModel;
10+
use PhpList\Core\Domain\Model\Interfaces\Identity;
11+
use PhpList\Core\Domain\Repository\Analytics\LinkTrackRepository;
12+
13+
#[ORM\Entity(repositoryClass: LinkTrackRepository::class)]
14+
#[ORM\Table(name: "phplist_linktrack")]
15+
#[ORM\UniqueConstraint(name: "miduidurlindex", columns: ["messageid", "userid", "url"])]
16+
#[ORM\Index(name: "midindex", columns: ["messageid"])]
17+
#[ORM\Index(name: "miduidindex", columns: ["messageid", "userid"])]
18+
#[ORM\Index(name: "uidindex", columns: ["userid"])]
19+
#[ORM\Index(name: "urlindex", columns: ["url"])]
20+
class LinkTrack implements DomainModel, Identity
21+
{
22+
#[ORM\Id]
23+
#[ORM\GeneratedValue]
24+
#[ORM\Column(name:'linkid', type: "integer")]
25+
private ?int $id = null;
26+
27+
#[ORM\Column(name: 'messageid', type: "integer")]
28+
private int $messageId;
29+
30+
#[ORM\Column(type: "integer", name: 'userid')]
31+
private int $userId;
32+
33+
#[ORM\Column(type: "string", length: 255, nullable: true)]
34+
private ?string $url = null;
35+
36+
#[ORM\Column(type: "string", length: 255, nullable: true)]
37+
private ?string $forward = null;
38+
39+
#[ORM\Column(name: 'firstclick', type: "datetime", nullable: true)]
40+
private ?DateTimeInterface $firstClick = null;
41+
42+
#[ORM\Column(name: 'latestclick', type: "datetime", nullable: true, options: ["default" => "CURRENT_TIMESTAMP"])]
43+
private ?DateTimeInterface $latestClick = null;
44+
45+
#[ORM\Column(type: "integer", nullable: true, options: ["default" => 0])]
46+
private int $clicked = 0;
47+
48+
public function getId(): int
49+
{
50+
return $this->id;
51+
}
52+
53+
public function getMessageId(): int
54+
{
55+
return $this->messageId;
56+
}
57+
58+
public function setMessageId(int $messageId): self
59+
{
60+
$this->messageId = $messageId;
61+
return $this;
62+
}
63+
64+
public function getUserId(): int
65+
{
66+
return $this->userId;
67+
}
68+
69+
public function setUserId(int $userId): self
70+
{
71+
$this->userId = $userId;
72+
return $this;
73+
}
74+
75+
public function getUrl(): ?string
76+
{
77+
return $this->url;
78+
}
79+
80+
public function setUrl(?string $url): self
81+
{
82+
$this->url = $url;
83+
return $this;
84+
}
85+
86+
public function getForward(): ?string
87+
{
88+
return $this->forward;
89+
}
90+
91+
public function setForward(?string $forward): self
92+
{
93+
$this->forward = $forward;
94+
return $this;
95+
}
96+
97+
public function getFirstClick(): ?DateTimeInterface
98+
{
99+
return $this->firstClick;
100+
}
101+
102+
public function setFirstClick(?DateTimeInterface $firstClick): self
103+
{
104+
$this->firstClick = $firstClick;
105+
return $this;
106+
}
107+
108+
public function getLatestClick(): ?DateTimeInterface
109+
{
110+
return $this->latestClick;
111+
}
112+
113+
public function setLatestClick(?DateTimeInterface $latestClick): self
114+
{
115+
$this->latestClick = $latestClick;
116+
return $this;
117+
}
118+
119+
public function getClicked(): int
120+
{
121+
return $this->clicked;
122+
}
123+
124+
public function setClicked(int $clicked): self
125+
{
126+
$this->clicked = $clicked;
127+
return $this;
128+
}
129+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PhpList\Core\Domain\Model\Analytics;
6+
7+
use Doctrine\ORM\Mapping as ORM;
8+
use PhpList\Core\Domain\Model\Interfaces\DomainModel;
9+
use PhpList\Core\Domain\Model\Interfaces\Identity;
10+
use PhpList\Core\Domain\Model\Traits\IdentityTrait;
11+
use PhpList\Core\Domain\Repository\Analytics\LinkTrackForwardRepository;
12+
13+
#[ORM\Entity(repositoryClass: LinkTrackForwardRepository::class)]
14+
#[ORM\Table(name: "phplist_linktrack_forward")]
15+
#[ORM\UniqueConstraint(name: "urlunique", columns: ["urlhash"])]
16+
#[ORM\Index(name: "urlindex", columns: ["url"])]
17+
#[ORM\Index(name: "uuididx", columns: ["uuid"])]
18+
class LinkTrackForward implements DomainModel, Identity
19+
{
20+
use IdentityTrait;
21+
22+
#[ORM\Column(type: "string", length: 2083, nullable: true)]
23+
private ?string $url = null;
24+
25+
#[ORM\Column(name: "urlhash", type: "string", length: 32, nullable: true)]
26+
private ?string $urlHash = null;
27+
28+
#[ORM\Column(type: "string", length: 36, nullable: true, options: ["default" => ""])]
29+
private ?string $uuid = '';
30+
31+
#[ORM\Column(type: "boolean", nullable: true, options: ["default" => 0])]
32+
private bool $personalise = false;
33+
34+
public function getUrl(): ?string
35+
{
36+
return $this->url;
37+
}
38+
39+
public function setUrl(?string $url): self
40+
{
41+
$this->url = $url;
42+
return $this;
43+
}
44+
45+
public function getUrlHash(): ?string
46+
{
47+
return $this->urlHash;
48+
}
49+
50+
public function setUrlHash(?string $urlHash): self
51+
{
52+
$this->urlHash = $urlHash;
53+
return $this;
54+
}
55+
56+
public function getUuid(): ?string
57+
{
58+
return $this->uuid;
59+
}
60+
61+
public function setUuid(?string $uuid): self
62+
{
63+
$this->uuid = $uuid;
64+
return $this;
65+
}
66+
67+
public function isPersonalise(): bool
68+
{
69+
return $this->personalise;
70+
}
71+
72+
public function setPersonalise(bool $personalise): self
73+
{
74+
$this->personalise = $personalise;
75+
return $this;
76+
}
77+
}
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace PhpList\Core\Domain\Model\Analytics;
6+
7+
use DateTimeInterface;
8+
use Doctrine\ORM\Mapping as ORM;
9+
use PhpList\Core\Domain\Model\Interfaces\DomainModel;
10+
use PhpList\Core\Domain\Repository\Analytics\LinkTrackMlRepository;
11+
12+
#[ORM\Entity(repositoryClass: LinkTrackMlRepository::class)]
13+
#[ORM\Table(name: "phplist_linktrack_ml")]
14+
#[ORM\Index(name: "fwdindex", columns: ["forwardid"])]
15+
#[ORM\Index(name: "midindex", columns: ["messageid"])]
16+
class LinkTrackMl implements DomainModel
17+
{
18+
#[ORM\Id]
19+
#[ORM\Column(name: "messageid", type: "integer")]
20+
private int $messageId;
21+
22+
#[ORM\Id]
23+
#[ORM\Column(name: "forwardid", type: "integer")]
24+
private int $forwardId;
25+
26+
#[ORM\Column(name: "firstclick", type: "datetime", nullable: true)]
27+
private ?DateTimeInterface $firstClick = null;
28+
29+
#[ORM\Column(name:'latestclick', type: "datetime", nullable: true)]
30+
private ?DateTimeInterface $latestClick = null;
31+
32+
#[ORM\Column(type: "integer", nullable: true, options: ["default" => 0])]
33+
private ?int $total = 0;
34+
35+
#[ORM\Column(type: "integer", nullable: true, options: ["default" => 0])]
36+
private ?int $clicked = 0;
37+
38+
#[ORM\Column(name: "htmlclicked", type: "integer", nullable: true, options: ["default" => 0])]
39+
private ?int $htmlClicked = 0;
40+
41+
#[ORM\Column(name: "textclicked", type: "integer", nullable: true, options: ["default" => 0])]
42+
private ?int $textClicked = 0;
43+
44+
public function getMessageId(): int
45+
{
46+
return $this->messageId;
47+
}
48+
49+
public function setMessageId(int $messageId): self
50+
{
51+
$this->messageId = $messageId;
52+
return $this;
53+
}
54+
55+
public function getForwardId(): int
56+
{
57+
return $this->forwardId;
58+
}
59+
60+
public function setForwardId(int $forwardId): self
61+
{
62+
$this->forwardId = $forwardId;
63+
return $this;
64+
}
65+
66+
public function getFirstClick(): ?DateTimeInterface
67+
{
68+
return $this->firstClick;
69+
}
70+
71+
public function setFirstClick(?DateTimeInterface $firstClick): self
72+
{
73+
$this->firstClick = $firstClick;
74+
return $this;
75+
}
76+
77+
public function getLatestClick(): ?DateTimeInterface
78+
{
79+
return $this->latestClick;
80+
}
81+
82+
public function setLatestClick(?DateTimeInterface $latestClick): self
83+
{
84+
$this->latestClick = $latestClick;
85+
return $this;
86+
}
87+
88+
public function getTotal(): ?int
89+
{
90+
return $this->total;
91+
}
92+
93+
public function setTotal(?int $total): self
94+
{
95+
$this->total = $total;
96+
return $this;
97+
}
98+
99+
public function getClicked(): ?int
100+
{
101+
return $this->clicked;
102+
}
103+
104+
public function setClicked(?int $clicked): self
105+
{
106+
$this->clicked = $clicked;
107+
return $this;
108+
}
109+
110+
public function getHtmlClicked(): ?int
111+
{
112+
return $this->htmlClicked;
113+
}
114+
115+
public function setHtmlClicked(?int $htmlClicked): self
116+
{
117+
$this->htmlClicked = $htmlClicked;
118+
return $this;
119+
}
120+
121+
public function getTextClicked(): ?int
122+
{
123+
return $this->textClicked;
124+
}
125+
126+
public function setTextClicked(?int $textClicked): self
127+
{
128+
$this->textClicked = $textClicked;
129+
return $this;
130+
}
131+
}

0 commit comments

Comments
 (0)