Tag   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 2
Metric Value
wmc 5
c 3
b 0
f 2
lcom 0
cbo 1
dl 0
loc 45
ccs 0
cts 20
cp 0
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getId() 0 4 1
A getName() 0 4 1
A setName() 0 4 1
A getPosts() 0 4 1
1
<?php
2
3
namespace Albert221\Blog\Entity;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
7
/**
8
 * @Entity(repositoryClass="\Albert221\Blog\Repository\Database\TagRepository") @Table(name="tags")
9
 */
10
class Tag
11
{
12
    /**
13
     * @var int Id
14
     * @Id @Column(type="integer") @GeneratedValue
15
     */
16
    protected $id;
17
18
    /**
19
     * @var string Name
20
     * @Column(type="string", unique=true)
21
     */
22
    protected $name;
23
24
    /**
25
     * @var ArrayCollection Posts
26
     * @ManyToMany(targetEntity="Post", mappedBy="tags")
27
     */
28
    protected $posts;
29
30
    public function __construct()
31
    {
32
        $this->posts = new ArrayCollection;
33
    }
34
35
    public function getId()
36
    {
37
        return $this->id;
38
    }
39
40
    public function getName()
41
    {
42
        return $this->name;
43
    }
44
45
    public function setName($name)
46
    {
47
        $this->name = $name;
48
    }
49
50
    public function getPosts()
51
    {
52
        return $this->posts;
53
    }
54
}
55