Genre   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 81
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
lcom 1
cbo 1
dl 0
loc 81
ccs 17
cts 17
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getLink() 0 4 1
A setName() 0 6 1
A getName() 0 4 1
A setLink() 0 6 1
A setItem() 0 8 2
A getItem() 0 4 1
1
<?php
2
/**
3
 * AnimeDb package.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2011, Peter Gribanov
7
 * @license   http://opensource.org/licenses/GPL-3.0 GPL v3
8
 */
9
10
namespace AnimeDb\Bundle\CatalogBundle\Entity\Widget;
11
12
/**
13
 * Widget item Genre.
14
 *
15
 * @author  Peter Gribanov <[email protected]>
16
 */
17
class Genre
18
{
19
    /**
20
     * @var string
21
     */
22
    protected $name = '';
23
24
    /**
25
     * Link on external catalog.
26
     *
27
     * @var string
28
     */
29
    protected $link = '';
30
31
    /**
32
     * @var Item
33
     */
34
    protected $item;
35
36
    /**
37
     * @param string $name
38
     *
39
     * @return Type
40
     */
41 1
    public function setName($name)
42
    {
43 1
        $this->name = $name;
44
45 1
        return $this;
46
    }
47
48
    /**
49
     * @return string
50
     */
51 1
    public function getName()
52
    {
53 1
        return $this->name;
54
    }
55
56
    /**
57
     * @param string $link
58
     *
59
     * @return Type
60
     */
61 1
    public function setLink($link)
62
    {
63 1
        $this->link = $link;
64
65 1
        return $this;
66
    }
67
68
    /**
69
     * @return string
70
     */
71 1
    public function getLink()
72
    {
73 1
        return $this->link;
74
    }
75
76
    /**
77
     * @param Item $item
78
     *
79
     * @return Type
80
     */
81 1
    public function setItem(Item $item)
82
    {
83 1
        if ($this->item !== $item) {
84 1
            $this->item = $item->addGenre($this);
85 1
        }
86
87 1
        return $this;
88
    }
89
90
    /**
91
     * @return Item
92
     */
93 1
    public function getItem()
94
    {
95 1
        return $this->item;
96
    }
97
}
98