Tag   A
last analyzed

Complexity

Total Complexity 12

Size/Duplication

Total Lines 156
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Importance

Changes 5
Bugs 0 Features 1
Metric Value
wmc 12
c 5
b 0
f 1
lcom 2
cbo 1
dl 0
loc 156
rs 10

11 Methods

Rating   Name   Duplication   Size   Complexity  
A getTitle() 0 4 1
A getSlug() 0 4 1
A getLink() 0 7 2
A getValuation() 0 4 1
A getContent() 0 4 1
A setTitle() 0 4 1
A setSlug() 0 4 1
A setLink() 0 4 1
A setValuation() 0 4 1
A setContent() 0 4 1
A getValuationSize() 0 4 1
1
<?php
2
3
/**
4
 * Tag
5
 */
6
7
namespace HDNET\Tagger\Domain\Model;
8
9
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
10
11
/**
12
 * Tag
13
 *
14
 * @db
15
 */
16
class Tag extends AbstractEntity
17
{
18
19
    /**
20
     * Title
21
     *
22
     * @var string
23
     * @db
24
     */
25
    protected $title;
26
27
    /**
28
     * Slug
29
     *
30
     * @var string
31
     * @db
32
     */
33
    protected $slug;
34
35
    /**
36
     * Link
37
     *
38
     * @var string
39
     * @db
40
     */
41
    protected $link;
42
43
    /**
44
     * Valuation
45
     *
46
     * @var float
47
     * @db
48
     */
49
    protected $valuation;
50
51
    /**
52
     * Content
53
     *
54
     * @var string
55
     * @db
56
     */
57
    protected $content;
58
59
    /**
60
     * Get title
61
     *
62
     * @return string
63
     */
64
    public function getTitle()
65
    {
66
        return $this->title;
67
    }
68
69
    /**
70
     * Get slug
71
     *
72
     * @return string
73
     */
74
    public function getSlug()
75
    {
76
        return $this->slug;
77
    }
78
79
    /**
80
     * Get link
81
     *
82
     * @return string
83
     */
84
    public function getLink()
85
    {
86
        if (trim($this->link) == '') {
87
            return false;
88
        }
89
        return $this->link;
90
    }
91
92
    /**
93
     * Get valuation
94
     *
95
     * @return float
96
     */
97
    public function getValuation()
98
    {
99
        return (float)$this->valuation;
100
    }
101
102
    /**
103
     * Get content
104
     *
105
     * @return string
106
     */
107
    public function getContent()
108
    {
109
        return $this->content;
110
    }
111
112
    /**
113
     * Set title
114
     *
115
     * @param string $title
116
     */
117
    public function setTitle($title)
118
    {
119
        $this->title = $title;
120
    }
121
122
    /**
123
     * Set slug
124
     *
125
     * @param string $slug
126
     */
127
    public function setSlug($slug)
128
    {
129
        $this->slug = $slug;
130
    }
131
132
    /**
133
     * Set link
134
     *
135
     * @param string $link
136
     */
137
    public function setLink($link)
138
    {
139
        $this->link = $link;
140
    }
141
142
    /**
143
     * Set valuation
144
     *
145
     * @param float $valuation
146
     */
147
    public function setValuation($valuation)
148
    {
149
        $this->valuation = $valuation;
150
    }
151
152
    /**
153
     * Set content
154
     *
155
     * @param string $content
156
     */
157
    public function setContent($content)
158
    {
159
        $this->content = $content;
160
    }
161
162
    /**
163
     * Get the real valuation for the tag cloud generator
164
     *
165
     * @return integer
166
     */
167
    public function getValuationSize()
168
    {
169
        return rand(8, 30);
170
    }
171
}
172