1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Kunstmaan\DashboardBundle\Entity; |
4
|
|
|
|
5
|
|
|
use Doctrine\ORM\Mapping as ORM; |
6
|
|
|
use Kunstmaan\AdminBundle\Entity\AbstractEntity; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* AnalyticsSegment |
10
|
|
|
* |
11
|
|
|
* @ORM\Table(name="kuma_analytics_segment") |
12
|
|
|
* @ORM\Entity(repositoryClass="Kunstmaan\DashboardBundle\Repository\AnalyticsSegmentRepository") |
13
|
|
|
*/ |
14
|
|
|
class AnalyticsSegment extends AbstractEntity |
15
|
|
|
{ |
16
|
|
|
/** |
17
|
|
|
* @var string |
18
|
|
|
* |
19
|
|
|
* @ORM\Column(name="name", type="string", length=255) |
20
|
|
|
*/ |
21
|
|
|
private $name; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @var string |
25
|
|
|
* |
26
|
|
|
* @ORM\Column(name="query", type="string", length=1000) |
27
|
|
|
*/ |
28
|
|
|
private $query; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @ORM\ManyToOne(targetEntity="AnalyticsConfig", inversedBy="segments") |
32
|
|
|
* @ORM\JoinColumn(name="config", referencedColumnName="id") |
33
|
|
|
*/ |
34
|
|
|
private $config; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @ORM\OneToMany(targetEntity="AnalyticsOverview", mappedBy="segment", cascade={"persist", "remove"}) |
38
|
|
|
*/ |
39
|
|
|
private $overviews; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Set name |
43
|
|
|
* |
44
|
|
|
* @param string $name |
45
|
|
|
* |
46
|
|
|
* @return AnalyticsSegment |
47
|
|
|
*/ |
48
|
|
|
public function setName($name) |
49
|
|
|
{ |
50
|
|
|
$this->name = $name; |
51
|
|
|
|
52
|
|
|
return $this; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Get name |
57
|
|
|
* |
58
|
|
|
* @return string |
59
|
|
|
*/ |
60
|
|
|
public function getName() |
61
|
|
|
{ |
62
|
|
|
return $this->name; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* Set query |
67
|
|
|
* |
68
|
|
|
* @param string $query |
69
|
|
|
* |
70
|
|
|
* @return AnalyticsSegment |
71
|
|
|
*/ |
72
|
|
|
public function setQuery($query) |
73
|
|
|
{ |
74
|
|
|
$this->query = $query; |
75
|
|
|
|
76
|
|
|
return $this; |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* Get query |
81
|
|
|
* |
82
|
|
|
* @return string |
83
|
|
|
*/ |
84
|
|
|
public function getQuery() |
85
|
|
|
{ |
86
|
|
|
return $this->query; |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* Get config |
91
|
|
|
* |
92
|
|
|
* @return integer |
93
|
|
|
*/ |
94
|
|
|
public function getConfig() |
95
|
|
|
{ |
96
|
|
|
return $this->config; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @param mixed $config |
101
|
|
|
*/ |
102
|
|
|
public function setConfig($config) |
103
|
|
|
{ |
104
|
|
|
$this->config = $config; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* Set overviews |
109
|
|
|
* |
110
|
|
|
* @param array $overviews |
111
|
|
|
* |
112
|
|
|
* @return $this |
113
|
|
|
*/ |
114
|
|
|
public function setOverviews($overviews) |
115
|
|
|
{ |
116
|
|
|
$this->overviews = $overviews; |
117
|
|
|
|
118
|
|
|
return $this; |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* Get overviews |
123
|
|
|
* |
124
|
|
|
* @return AnalyticsGoal[] |
125
|
|
|
*/ |
126
|
|
|
public function getOverviews() |
127
|
|
|
{ |
128
|
|
|
return $this->overviews; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
} |
132
|
|
|
|