|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
/* |
|
6
|
|
|
* This file is part of the Superdesk Web Publisher Analytics Bundle. |
|
7
|
|
|
* |
|
8
|
|
|
* Copyright 2017 Sourcefabric z.ú. and contributors. |
|
9
|
|
|
* |
|
10
|
|
|
* For the full copyright and license information, please see the |
|
11
|
|
|
* AUTHORS and LICENSE files distributed with this source code. |
|
12
|
|
|
* |
|
13
|
|
|
* @copyright 2017 Sourcefabric z.ú |
|
14
|
|
|
* @license http://www.superdesk.org/license |
|
15
|
|
|
*/ |
|
16
|
|
|
|
|
17
|
|
|
namespace SWP\Bundle\AnalyticsBundle\Model; |
|
18
|
|
|
|
|
19
|
|
|
use SWP\Bundle\ContentBundle\Model\RouteInterface; |
|
20
|
|
|
use SWP\Bundle\ContentBundle\Model\ArticleInterface; |
|
21
|
|
|
use SWP\Component\Common\Model\TimestampableInterface; |
|
22
|
|
|
use SWP\Component\Common\Model\TimestampableTrait; |
|
23
|
|
|
|
|
24
|
|
|
class ArticleEvent implements ArticleEventInterface, TimestampableInterface |
|
25
|
|
|
{ |
|
26
|
|
|
use TimestampableTrait; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @var null|int |
|
30
|
|
|
*/ |
|
31
|
|
|
protected $id; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @var string |
|
35
|
|
|
*/ |
|
36
|
|
|
protected $action; |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* @var null|RouteInterface |
|
40
|
|
|
*/ |
|
41
|
|
|
protected $impressionRoute; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @var null|ArticleInterface |
|
45
|
|
|
*/ |
|
46
|
|
|
protected $impressionArticle; |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* @var null|string |
|
50
|
|
|
*/ |
|
51
|
|
|
protected $impressionType; |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* @var ArticleStatisticsInterface |
|
55
|
|
|
*/ |
|
56
|
|
|
protected $articleStatistics; |
|
57
|
|
|
|
|
58
|
|
|
public function getId(): ?int |
|
59
|
|
|
{ |
|
60
|
|
|
return $this->id; |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
public function getAction(): string |
|
64
|
|
|
{ |
|
65
|
|
|
return $this->action; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
public function setAction(string $action): void |
|
69
|
|
|
{ |
|
70
|
|
|
$this->action = $action; |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
public function getImpressionRoute(): ?RouteInterface |
|
74
|
|
|
{ |
|
75
|
|
|
return $this->impressionRoute; |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
|
|
public function setImpressionRoute(?RouteInterface $impressionRoute): void |
|
79
|
|
|
{ |
|
80
|
|
|
$this->impressionRoute = $impressionRoute; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
public function getImpressionArticle(): ?ArticleInterface |
|
84
|
|
|
{ |
|
85
|
|
|
return $this->impressionArticle; |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
public function setImpressionArticle(?ArticleInterface $impressionArticle): void |
|
89
|
|
|
{ |
|
90
|
|
|
$this->impressionArticle = $impressionArticle; |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
|
|
public function getImpressionType(): ?string |
|
94
|
|
|
{ |
|
95
|
|
|
return $this->impressionType; |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
public function setImpressionType(?string $impressionType): void |
|
99
|
|
|
{ |
|
100
|
|
|
$this->impressionType = $impressionType; |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
public function getArticleStatistics(): ArticleStatisticsInterface |
|
104
|
|
|
{ |
|
105
|
|
|
return $this->articleStatistics; |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
public function setArticleStatistics(ArticleStatisticsInterface $articleStatistics): void |
|
109
|
|
|
{ |
|
110
|
|
|
$this->articleStatistics = $articleStatistics; |
|
111
|
|
|
} |
|
112
|
|
|
} |
|
113
|
|
|
|