Source   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 68
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getLabel() 0 3 1
A setLabel() 0 5 1
A __toString() 0 3 1
A getId() 0 3 1
A setId() 0 5 1
1
<?php
2
3
namespace ProjetNormandie\ComptaBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Symfony\Component\Validator\Constraints as Assert;
7
8
/**
9
 * Type
10
 *
11
 * @ORM\Table(name="cpt_compta_source")
12
 * @ORM\Entity
13
 */
14
class Source
15
{
16
    /**
17
     * @var integer
18
     *
19
     * @ORM\Column(name="id", type="integer")
20
     * @ORM\Id
21
     * @ORM\GeneratedValue(strategy="IDENTITY")
22
     */
23
    private $id;
24
25
    /**
26
     * @var string
27
     *
28
     * @Assert\Length(min="2", max="50")
29
     * @ORM\Column(name="label", type="string",  nullable=false)
30
     */
31
    private $label;
32
33
    /**
34
     * Get id
35
     *
36
     * @return integer
37
     */
38
    public function getId()
39
    {
40
        return $this->id;
41
    }
42
43
    /**
44
     * Set id
45
     *
46
     * @param int $id
47
     * @return $this
48
     */
49
    public function setId($id)
50
    {
51
        $this->id = $id;
52
53
        return $this;
54
    }
55
56
57
    /**
58
     * @param string $label
59
     * @return $this
60
     */
61
    public function setLabel($label)
62
    {
63
        $this->label = $label;
64
65
        return $this;
66
    }
67
68
    /**
69
     * @return string
70
     */
71
    public function getLabel()
72
    {
73
        return $this->label;
74
    }
75
76
    /**
77
     * @return string
78
     */
79
    public function __toString()
80
    {
81
        return sprintf('%s [%d]', $this->getLabel(), $this->getId());
82
    }
83
}
84