Attribute   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 82
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 9
Bugs 3 Features 1
Metric Value
wmc 6
c 9
b 3
f 1
lcom 0
cbo 1
dl 0
loc 82
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 4 1
A getId() 0 4 1
A setValue() 0 6 1
A getValue() 0 4 1
A setDefinition() 0 6 1
A getDefinition() 0 4 1
1
<?php
2
3
namespace Padam87\AttributeBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
7
/**
8
 * @ORM\Entity()
9
 * @ORM\Table("attribute")
10
 */
11
class Attribute
12
{
13
    /**
14
     * @var int
15
     *
16
     * @ORM\Id
17
     * @ORM\Column(type="integer")
18
     * @ORM\GeneratedValue(strategy="AUTO")
19
     */
20
    private $id;
21
22
    /**
23
     * @var string
24
     *
25
     * @ORM\Column(type="string", length=255, nullable=true)
26
     */
27
    private $value;
28
29
    /**
30
     * @var Definition
31
     *
32
     * @ORM\ManyToOne(targetEntity="Definition", inversedBy="attributes")
33
     * @ORM\JoinColumn(name="definition_id", referencedColumnName="id", nullable=false)
34
     */
35
    private $definition;
36
37
    /**
38
     * @return string
39
     */
40
    public function __toString()
41
    {
42
        return $this->getDefinition()->getName();
43
    }
44
45
    /**
46
     * @return integer
47
     */
48
    public function getId()
49
    {
50
        return $this->id;
51
    }
52
53
    /**
54
     * @param string $value
55
     *
56
     * @return Attribute
57
     */
58
    public function setValue($value)
59
    {
60
        $this->value = $value;
61
62
        return $this;
63
    }
64
65
    /**
66
     * @return string
67
     */
68
    public function getValue()
69
    {
70
        return $this->value;
71
    }
72
73
    /**
74
     * @param Definition $definition
75
     *
76
     * @return Attribute
77
     */
78
    public function setDefinition(Definition $definition = null)
79
    {
80
        $this->definition = $definition;
81
82
        return $this;
83
    }
84
85
    /**
86
     * @return Definition
87
     */
88
    public function getDefinition()
89
    {
90
        return $this->definition;
91
    }
92
}
93