Completed
Push — master ( 446c01...fcb59d )
by Ruud
113:27 queued 101:23
created

AnalyticsSegment   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 123
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 1
dl 0
loc 123
ccs 20
cts 20
cp 1
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A setName() 0 6 1
A getName() 0 4 1
A setQuery() 0 6 1
A getQuery() 0 4 1
A getConfig() 0 4 1
A setConfig() 0 6 1
A setoverviews() 0 6 1
A getOverviews() 0 4 1
1
<?php
2
3
namespace Kunstmaan\DashboardBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
/**
8
 * AnalyticsSegment
9
 *
10
 * @ORM\Table(name="kuma_analytics_segment")
11
 * @ORM\Entity(repositoryClass="Kunstmaan\DashboardBundle\Repository\AnalyticsSegmentRepository")
12
 */
13
class AnalyticsSegment extends \Kunstmaan\AdminBundle\Entity\AbstractEntity
14
{
15
    /**
16
     * @var string
17
     *
18
     * @ORM\Column(name="name", type="string", length=255)
19
     */
20
    private $name;
21
22
    /**
23
     * @var string
24
     *
25
     * @ORM\Column(name="query", type="string", length=1000)
26
     */
27
    private $query;
28
29
    /**
30
     * @ORM\ManyToOne(targetEntity="AnalyticsConfig", inversedBy="segments")
31
     * @ORM\JoinColumn(name="config", referencedColumnName="id")
32
     */
33
    private $config;
34
35
    /**
36
     * @ORM\OneToMany(targetEntity="AnalyticsOverview", mappedBy="segment", cascade={"persist", "remove"})
37
     */
38
    private $overviews;
39
40
    /**
41
     * Set name
42
     *
43
     * @param string $name
44
     *
45
     * @return AnalyticsSegment
46
     */
47 1
    public function setName($name)
48
    {
49 1
        $this->name = $name;
50
51 1
        return $this;
52
    }
53
54
    /**
55
     * Get name
56
     *
57
     * @return string
58
     */
59 1
    public function getName()
60
    {
61 1
        return $this->name;
62
    }
63
64
    /**
65
     * Set query
66
     *
67
     * @param string $query
68
     *
69
     * @return AnalyticsSegment
70
     */
71 1
    public function setQuery($query)
72
    {
73 1
        $this->query = $query;
74
75 1
        return $this;
76
    }
77
78
    /**
79
     * Get query
80
     *
81
     * @return string
82
     */
83 1
    public function getQuery()
84
    {
85 1
        return $this->query;
86
    }
87
88
    /**
89
     * Get config
90
     *
91
     * @return int
92
     */
93 1
    public function getConfig()
94
    {
95 1
        return $this->config;
96
    }
97
98
    /**
99
     * Set config
100
     *
101
     * @param int $config
102
     *
103
     * @return AnalyticsTopReferrals
0 ignored issues
show
Documentation introduced by
Should the return type not be AnalyticsSegment?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
104
     */
105 1
    public function setConfig($config)
106
    {
107 1
        $this->config = $config;
108
109 1
        return $this;
110
    }
111
112
    /**
113
     * Set overviews
114
     *
115
     * @param array $overviews
116
     *
117
     * @return $this
118
     */
119 1
    public function setoverviews($overviews)
120
    {
121 1
        $this->overviews = $overviews;
122
123 1
        return $this;
124
    }
125
126
    /**
127
     * Get overviews
128
     *
129
     * @return AnalyticsGoal[]
130
     */
131 1
    public function getOverviews()
132
    {
133 1
        return $this->overviews;
134
    }
135
}
136